| |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
javax.swing.text.html
类 HTMLWriter
java.lang.Object javax.swing.text.AbstractWriter javax.swing.text.html.HTMLWriter
public class HTMLWriter
- extends AbstractWriter
这是用于 HTMLDocuments 的 writer。
字段摘要 |
---|
从类 javax.swing.text.AbstractWriter 继承的字段 |
---|
NEWLINE |
构造方法摘要 | |
---|---|
HTMLWriter(Writer w, HTMLDocument doc) 创建新的 HTMLWriter。 | |
HTMLWriter(Writer w, HTMLDocument doc, int pos, int len) 创建新的 HTMLWriter。 |
方法摘要 | |
---|---|
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) 重写此方法来映射任何字符实体,例如 < 映射到 <。 |
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() 对 Element 树进行迭代并控制所有标记及其属性的写出。 |
protected void | writeAttributes(AttributeSet attr) 写出属性集。 |
protected void | writeEmbeddedTags(AttributeSet attr) 搜索 AttributeSet 中的嵌入式标记并写出它们。 |
protected void | writeLineSeparator() 写出行分隔符。 |
protected void | writeOption(Option option) 写出 Option 表单元素的内容。 |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
HTMLWriter
public HTMLWriter(Writer w, HTMLDocument doc)
- 创建新的 HTMLWriter。
- 参数:
w
- Writerdoc
- HTMLDocument
HTMLWriter
public HTMLWriter(Writer w, HTMLDocument doc, int pos, int len)
- 创建新的 HTMLWriter。
- 参数:
w
- Writerdoc
- HTMLDocumentpos
- 文档位置,从此位置获取内容len
- 写出量
方法详细信息 |
---|
write
public void write() throws IOException, BadLocationException
- 对 Element 树进行迭代并控制所有标记及其属性的写出。
- 指定者:
- 类
AbstractWriter
中的write
- 抛出:
IOException
- 如果发生任何 I/O 错误BadLocationException
- 如果 pos 表示文档中的无效位置。
writeAttributes
protected void writeAttributes(AttributeSet attr) throws IOException
- 写出属性集。忽略带有类型 HTML.Tag 键的所有属性,带有类型 StyleConstants 键的所有属性,以及带有类型 HTML.Attribute.ENDTAG 键的所有属性。
- 覆盖:
- 类
AbstractWriter
中的writeAttributes
- 参数:
attr
- AttributeSet- 抛出:
IOException
- 如果发生任何 I/O 错误
emptyTag
protected void emptyTag(Element elem) throws BadLocationException, IOException
- 写出所有空元素(没有对应结束标记的所有标记)。
- 参数:
elem
- Element- 抛出:
IOException
- 如果发生任何 I/O 错误BadLocationException
- 如果 pos 表示文档中的无效位置。
isBlockTag
protected boolean isBlockTag(AttributeSet attr)
- 确定与该元素关联的 HTML.Tag 是否为块标记。
- 参数:
attr
- AttributeSet- 返回:
- 如果标记是块标记,则返回 true;否则返回 false。
startTag
protected void startTag(Element elem) throws IOException, BadLocationException
- 写出元素的开始标记。忽略所有的合成元素。
- 参数:
elem
- Element- 抛出:
IOException
- 如果发生任何 I/O 错误BadLocationException
textAreaContent
protected void textAreaContent(AttributeSet attr) throws BadLocationException, IOException
- 写出 TEXTAREA 表单元素中所包含的文本。
- 参数:
attr
- AttributeSet- 抛出:
IOException
- 如果发生任何 I/O 错误BadLocationException
- 如果 pos 表示文档中的无效位置。