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标签与元素相关联的是一块标记。
|
protected boolean |
matchNameAttribute(AttributeSet attr, HTML.Tag tag)
如果styleconstants.nameattribute等于作为参数传入的标签返回true。
|
protected void |
output(char[] chars, int start, int length)
这种方法是修改Map任何字符实体,如<& lt;。
|
protected void |
selectContent(AttributeSet attr)
写出选择窗体元素的内容。
|
protected void |
startTag(Element elem)
为元素写了一个开始标记。
|
protected boolean |
synthesizedElement(Element elem)
如果元素是一个合成元素,则返回真。
|
protected void |
text(Element elem)
写文本。
|
protected void |
textAreaContent(AttributeSet attr)
写出来的,是包含在一个文本形式的元素文本。
|
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, write
public HTMLWriter(Writer w, HTMLDocument doc)
w
-作家
doc
-这
public HTMLWriter(Writer w, HTMLDocument doc, int pos, int len)
w
-作家
doc
-这
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
- attributeset
protected void startTag(Element elem) throws IOException, BadLocationException
elem
-元素
IOException
-任何I/O错误
BadLocationException
protected void textAreaContent(AttributeSet attr) throws BadLocationException, IOException
attr
- attributeset
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
-
protected void writeOption(Option option) throws IOException
option
-一个选项
IOException
-任何I/O错误
protected void endTag(Element elem) throws IOException
elem
-元素
IOException
-
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.