public class HTMLWriter extends AbstractWriter
NEWLINE| Constructor and Description |
|---|
HTMLWriter(Writer w, HTMLDocument doc)
创建一个新的HTMLWriter。
|
HTMLWriter(Writer w, HTMLDocument doc, int pos, int len)
创建一个新的HTMLWriter。
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeOutUnwantedEmbeddedTags(AttributeSet attr)
搜索属性集和存储在标签向量中的每个标签。
|
protected void |
comment(Element elem)
写出评论。
|
protected void |
emptyTag(Element elem)
写出所有空的元素(所有没有相应的结束标签的标签)。
|
protected void |
endTag(Element elem)
写出元素的结束标签。
|
protected boolean |
isBlockTag(AttributeSet attr)
确定与元素关联的HTML.Tag是否是块标记。
|
protected boolean |
matchNameAttribute(AttributeSet attr, HTML.Tag tag)
如果StyleConstants.NameAttribute等于作为参数传入的标签,则返回true。
|
protected void |
output(char[] chars, int start, int length)
该方法被覆盖以映射任何字符实体,例如<到&lt;。
|
protected void |
selectContent(AttributeSet attr)
写出SELECT表单元素的内容。
|
protected void |
startTag(Element elem)
写出元素的开始标签。
|
protected boolean |
synthesizedElement(Element elem)
如果元素是合成元素,则返回true。
|
protected void |
text(Element elem)
写出文字。
|
protected void |
textAreaContent(AttributeSet attr)
写出TEXTAREA表单元素中包含的文本。
|
void |
write()
迭代元素树,并控制所有标签及其属性的写入。
|
protected void |
writeAttributes(AttributeSet attr)
写出属性集。
|
protected void |
writeEmbeddedTags(AttributeSet attr)
在AttributeSet中搜索嵌入式标签并将其写入。
|
protected void |
writeLineSeparator()
写行分隔符。
|
protected void |
writeOption(Option option)
写出选项表单元素的内容。
|
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(Writer w, HTMLDocument doc)
w - 作家
doc - 一个HTMLDocument
public HTMLWriter(Writer w, HTMLDocument doc, int pos, int len)
w - 作家
doc - 一个HTMLDocument
pos - 从中获取内容的文档位置
len - 写出的金额
public void write()
throws IOException,
BadLocationException
write在
AbstractWriter
IOException - 在任何I / O错误
BadLocationException - 如果pos表示文档中的无效位置。
protected void writeAttributes(AttributeSet attr) throws IOException
writeAttributes在
AbstractWriter类
attr - 一个AttributeSet
IOException - 在任何I / O错误
protected void emptyTag(Element elem) throws BadLocationException, IOException
elem - 一个元素
IOException - 任何I / O错误
BadLocationException - 如果pos表示文档中的无效位置。
protected boolean isBlockTag(AttributeSet attr)
attr - 属性集
protected void startTag(Element elem) throws IOException, BadLocationException
elem - 元素
IOException - 在任何I / O错误
BadLocationException
protected void textAreaContent(AttributeSet attr) throws BadLocationException, IOException
attr - 属性集
IOException - 任何I / O错误
BadLocationException - 如果pos表示文档中的无效位置。
protected void text(Element elem) throws BadLocationException, IOException
text在
AbstractWriter
elem - 一个元素
IOException - 在任何I / O错误
BadLocationException - 如果pos表示文档中的无效位置。
protected void selectContent(AttributeSet attr) throws IOException
attr - 与表单元素关联的AttributeSet
IOException - 在任何I / O错误
protected void writeOption(Option option) throws IOException
option - 一个选项
IOException - 任何I / O错误
protected void endTag(Element elem) throws IOException
elem - 一个元素
IOException - 任何I / O错误
protected void comment(Element elem) throws BadLocationException, IOException
elem - 一个元素
IOException - 在任何I / O错误
BadLocationException - 如果pos表示文档中的无效位置。
protected boolean synthesizedElement(Element elem)
protected boolean matchNameAttribute(AttributeSet attr, HTML.Tag tag)
protected void writeEmbeddedTags(AttributeSet attr) throws IOException
IOException - 任何I / O错误
protected void closeOutUnwantedEmbeddedTags(AttributeSet attr) throws IOException
IOException - 在任何I / O错误
protected void writeLineSeparator()
throws IOException
writeLineSeparator在
AbstractWriter
IOException
protected void output(char[] chars,
int start,
int length)
throws IOException
super.output将被调用来写入内容。
output在
AbstractWriter
IOException
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.