| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public class HTMLWriter extends AbstractWriter
This is a writer for HTMLDocuments.
Field Summary |
---|
Fields inherited from class javax.swing.text.AbstractWriter |
---|
NEWLINE |
Constructor Summary | |
---|---|
HTMLWriter(Writer w, HTMLDocument doc) Creates a new HTMLWriter. |
|
HTMLWriter(Writer w, HTMLDocument doc, int pos, int len) Creates a new HTMLWriter. |
Method Summary | |
---|---|
protected void |
Searches the attribute set and for each tag that is stored in the tag vector. |
protected void |
Writes out comments. |
protected void |
Writes out all empty elements (all tags that have no corresponding end tag). |
protected void |
Writes out an end tag for the element. |
protected boolean |
isBlockTag(AttributeSet attr) Determines if the HTML.Tag associated with the element is a block tag. |
protected boolean |
matchNameAttribute(AttributeSet attr, HTML.Tag tag) Returns true if the StyleConstants.NameAttribute is equal to the tag that is passed in as a parameter. |
protected void |
output(char[] chars, int start, int length) This method is overriden to map any character entities, such as < to <. |
protected void |
selectContent(AttributeSet attr) Writes out the content of the SELECT form element. |
protected void |
Writes out a start tag for the element. |
protected boolean |
synthesizedElement(Element elem) Returns true if the element is a synthesized element. |
protected void |
Writes out text. |
protected void |
textAreaContent(AttributeSet attr) Writes out text that is contained in a TEXTAREA form element. |
void |
write() Iterates over the Element tree and controls the writing out of all the tags and its attributes. |
protected void |
writeAttributes(AttributeSet attr) Writes out the attribute set. |
protected void |
Searches for embedded tags in the AttributeSet and writes them out. |
protected void |
Writes the line separator. |
protected void |
writeOption(Option option) Writes out the content of the Option form element. |
Methods inherited from class javax.swing.text.AbstractWriter |
---|
decrIndent, getCanWrapLines, getCurrentLineLength, getDocument, getElementIterator, getEndOffset, getIndentLevel, getIndentSpace, getLineLength, getLineSeparator, getStartOffset, getText, getWriter, incrIndent, indent, inRange, isLineEmpty, output, setCanWrapLines, setCurrentLineLength, setIndentSpace, setLineLength, setLineSeparator, text, write, write, write, write, writeAttributes, writeLineSeparator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HTMLWriter(Writer w, HTMLDocument doc)
w
- a Writerdoc
- an HTMLDocumentpublic HTMLWriter(Writer w, HTMLDocument doc, int pos, int len)
w
- a Writerdoc
- an HTMLDocumentpos
- the document location from which to fetch the contentlen
- the amount to write outMethod Detail |
---|
protected void closeOutUnwantedEmbeddedTags(AttributeSet attr) throws IOException
attr
IOException
- on any I/O errorprotected void comment(Element elem) throws BadLocationException, IOException
elem
- an ElementBadLocationException
- if pos represents an invalid
location within the document.IOException
- on any I/O errorprotected void emptyTag(Element elem) throws BadLocationException, IOException
elem
- an ElementBadLocationException
- if pos represents an invalid
location within the document.IOException
- on any I/O errorprotected void endTag(Element elem) throws IOException
elem
- an ElementIOException
- on any I/O errorprotected boolean isBlockTag(AttributeSet attr)
attr
- an AttributeSetprotected boolean matchNameAttribute(AttributeSet attr, HTML.Tag tag)
attr
tag
protected void output(char[] chars, int start, int length) throws IOException
super.output
will be invoked to
write the content.
output
in class AbstractWriter
chars
start
length
IOException
protected void selectContent(AttributeSet attr) throws IOException
attr
- the AttributeSet associated with the form elementIOException
- on any I/O errorprotected void startTag(Element elem) throws IOException, BadLocationException
elem
- an ElementIOException
- on any I/O errorBadLocationException
protected boolean synthesizedElement(Element elem)
elem
protected void text(Element elem) throws BadLocationException, IOException
text
in class AbstractWriter
elem
- an ElementBadLocationException
- if pos represents an invalid
location within the document.IOException
- on any I/O errorprotected void textAreaContent(AttributeSet attr) throws BadLocationException, IOException
attr
- an AttributeSetBadLocationException
- if pos represents an invalid
location within the document.IOException
- on any I/O errorpublic void write() throws IOException, BadLocationException
write
in class AbstractWriter
IOException
- on any I/O errorBadLocationException
- if pos represents an invalid
location within the document.protected void writeAttributes(AttributeSet attr) throws IOException
writeAttributes
in class AbstractWriter
attr
- an AttributeSetIOException
- on any I/O errorprotected void writeEmbeddedTags(AttributeSet attr) throws IOException
attr
IOException
- on any I/O errorprotected void writeLineSeparator() throws IOException
writeLineSeparator
in class AbstractWriter
IOException
protected void writeOption(Option option) throws IOException
option
- an OptionIOException
- on any I/O error
| |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |