public class HTMLWriter extends AbstractWriter
NEWLINE| Constructor and Description |
|---|
HTMLWriter(Writer
Creates a new HTMLWriter.
|
HTMLWriter(Writer
Creates a new HTMLWriter.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeOutUnwantedEmbeddedTags(AttributeSet
Searches the attribute set and for each tag that is stored in the tag vector.
|
protected void |
comment(Element
Writes out comments.
|
protected void |
emptyTag(Element
Writes out all empty elements (all tags that have no corresponding end tag).
|
protected void |
endTag(Element
Writes out an end tag for the element.
|
protected boolean |
isBlockTag(AttributeSet
Determines if the HTML.Tag associated with the element is a block tag.
|
protected boolean |
matchNameAttribute(AttributeSet
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
Writes out the content of the SELECT form element.
|
protected void |
startTag(Element
Writes out a start tag for the element.
|
protected boolean |
synthesizedElement(Element
Returns true if the element is a synthesized element.
|
protected void |
text(Element
Writes out text.
|
protected void |
textAreaContent(AttributeSet
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
Writes out the attribute set.
|
protected void |
writeEmbeddedTags(AttributeSet
Searches for embedded tags in the AttributeSet and writes them out.
|
protected void |
writeLineSeparator()
Writes the line separator.
|
protected void |
writeOption(Option
Writes out the content of the Option form element.
|
decrIndent, getCanWrapLines, getCurrentLineLength, getDocument, getElementIterator, getEndOffset, getIndentLevel, getIndentSpace, getLineLength, getLineSeparator, getStartOffset, getText, getWriter, incrIndent, indent, inRange, isLineEmpty, setCanWrapLines, setCurrentLineLength, setIndentSpace, setLineLength, setLineSeparator, write, write, writepublic HTMLWriter(Writerw, HTMLDocument doc)
w - a Writer
doc - an HTMLDocument
public HTMLWriter(Writerw, HTMLDocument doc, int pos, int len)
w - a Writer
doc - an HTMLDocument
pos - the document location from which to fetch the content
len - the amount to write out
public void write()
throws IOException,
BadLocationException
write in class
AbstractWriter
IOException - on any I/O error
BadLocationException - if pos represents an invalid location within the document.
protected void writeAttributes(AttributeSetattr) throws IOException
writeAttributes in class
AbstractWriter
attr - an AttributeSet
IOException - on any I/O error
protected void emptyTag(Elementelem) throws BadLocationException , IOException
elem - an Element
IOException - on any I/O error
BadLocationException - if pos represents an invalid location within the document.
protected boolean isBlockTag(AttributeSetattr)
attr - an AttributeSet
protected void startTag(Elementelem) throws IOException , BadLocationException
elem - an Element
IOException - on any I/O error
BadLocationException
protected void textAreaContent(AttributeSetattr) throws BadLocationException , IOException
attr - an AttributeSet
IOException - on any I/O error
BadLocationException - if pos represents an invalid location within the document.
protected void text(Elementelem) throws BadLocationException , IOException
text in class
AbstractWriter
elem - an Element
IOException - on any I/O error
BadLocationException - if pos represents an invalid location within the document.
protected void selectContent(AttributeSetattr) throws IOException
attr - the AttributeSet associated with the form element
IOException - on any I/O error
protected void writeOption(Optionoption) throws IOException
option - an Option
IOException - on any I/O error
protected void endTag(Elementelem) throws IOException
elem - an Element
IOException - on any I/O error
protected void comment(Elementelem) throws BadLocationException , IOException
elem - an Element
IOException - on any I/O error
BadLocationException - if pos represents an invalid location within the document.
protected boolean synthesizedElement(Elementelem)
protected boolean matchNameAttribute(AttributeSetattr, HTML .Tag tag)
protected void writeEmbeddedTags(AttributeSetattr) throws IOException
IOException - on any I/O error
protected void closeOutUnwantedEmbeddedTags(AttributeSetattr) throws IOException
IOException - on any I/O error
protected void writeLineSeparator()
throws IOException
writeLineSeparator in class
AbstractWriter
IOException
protected void output(char[] chars,
int start,
int length)
throws IOException
super.output will be invoked to write the content.
output in class
AbstractWriter
IOException