JavaTM 2 Platform
Standard Ed. 5.0

javax.swing.text.html
类 HTMLEditorKit.ParserCallback

java.lang.Object
  继承者 javax.swing.text.html.HTMLEditorKit.ParserCallback
直接已知子类:
HTMLDocument.HTMLReader
正在封闭类:
HTMLEditorKit

public static class HTMLEditorKit.ParserCallback
extends Object

解析结果驱动这些回调方法。打开和关闭动作应该是对称的。flush 方法将是最后一个调用的方法,以便接收者有机会将任何挂起的数据刷新到文档中。

有关 AttributeSets 的内容、位置和其他信息,请参考 DocumentParser,它是所使用的默认解析器。

另请参见:
DocumentParser

字段摘要
static Object IMPLIED
          这是作为属性集中的一个属性来传递的,用来指示元素是隐含的,例如字符串 '<>foo<\t>' 包含隐含的 html 元素和隐含的正文元素。
 
构造方法摘要
HTMLEditorKit.ParserCallback()
           
 
方法摘要
 void flush()
           
 void handleComment(char[] data, int pos)
           
 void handleEndOfLineString(String eol)
          它的调用是在完成流的解析之后且在调用 flush 之前。
 void handleEndTag(HTML.Tag t, int pos)
           
 void handleError(String errorMsg, int pos)
           
 void handleSimpleTag(HTML.Tag t, MutableAttributeSet a, int pos)
           
 void handleStartTag(HTML.Tag t, MutableAttributeSet a, int pos)
           
 void handleText(char[] data, int pos)
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

IMPLIED

public static final Object IMPLIED
这是作为属性集中的一个属性来传递的,用来指示元素是隐含的,例如字符串 '<>foo<\t>' 包含隐含的 html 元素和隐含的正文元素。

从以下版本开始:
1.3
构造方法详细信息

HTMLEditorKit.ParserCallback

public HTMLEditorKit.ParserCallback()
方法详细信息

flush

public void flush()
           throws BadLocationException
抛出:
BadLocationException

handleText

public void handleText(char[] data,
                       int pos)

handleComment

public void handleComment(char[] data,
                          int pos)

handleStartTag

public void handleStartTag(HTML.Tag t,
                           MutableAttributeSet a,
                           int pos)

handleEndTag

public void handleEndTag(HTML.Tag t,
                         int pos)

handleSimpleTag

public void handleSimpleTag(HTML.Tag t,
                            MutableAttributeSet a,
                            int pos)

handleError

public void handleError(String errorMsg,
                        int pos)

handleEndOfLineString

public void handleEndOfLineString(String eol)
它的调用是在完成流的解析之后且在调用 flush 之前。eol 将是 \n、\r 或 \r\n 中的一个,它是在解析流时最常遇到的。

从以下版本开始:
1.3

JavaTM 2 Platform
Standard Ed. 5.0

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java 2 SDK SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2004 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策