Package org.custommonkey.xmlunit
Class HTMLDocumentBuilder.SwingEvent2SaxAdapter
java.lang.Object
javax.swing.text.html.HTMLEditorKit.ParserCallback
org.custommonkey.xmlunit.HTMLDocumentBuilder.SwingEvent2SaxAdapter
- Enclosing class:
- HTMLDocumentBuilder
Adapts Swing HTML callback messages to Sax equivalents, passing them
to a Sax-aware ContentHandler.
-
Field Summary
Fields inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
IMPLIED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidflush()Swing-HTML-parser template method, no ContentHandler equivalentvoidhandleComment(char[] data, int pos) Equivalent to Sax LexicalHandlercommentmethod.voidhandleEndTag(HTML.Tag tag, int pos) Equivalent to SaxendElementvoidhandleError(String errorMsg, int pos) Swing-HTML-parser template method, no ContentHandler equivalent.voidhandleSimpleTag(HTML.Tag tag, MutableAttributeSet attributeSet, int pos) Equivalent to SaxstartElementplusendElementvoidhandleStartTag(HTML.Tag tag, MutableAttributeSet attributeSet, int pos) Equivalent to SaxstartElementvoidhandleText(char[] data, int pos) Equivalent to Saxcharactersvoidparse(Reader reader, ContentHandler saxContentHandler) Perform Swing-HTML-parse-event-to-Sax-event conversionMethods inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
handleEndOfLineString
-
Constructor Details
-
SwingEvent2SaxAdapter
public SwingEvent2SaxAdapter()Default constructor
-
-
Method Details
-
parse
Perform Swing-HTML-parse-event-to-Sax-event conversion- Parameters:
reader- reader to read the document fromsaxContentHandler- content handler receiving SAX events while parsing the document- Throws:
SAXException- if the parser feels like itIOException- on I/O errors
-
flush
Swing-HTML-parser template method, no ContentHandler equivalent- Overrides:
flushin classHTMLEditorKit.ParserCallback- Throws:
BadLocationException
-
handleText
public void handleText(char[] data, int pos) Equivalent to Saxcharacters- Overrides:
handleTextin classHTMLEditorKit.ParserCallback
-
handleComment
public void handleComment(char[] data, int pos) Equivalent to Sax LexicalHandlercommentmethod. If the supplied ContentHandler is also an LexicalHandler then the cast will be made and the sax event passed on.- Overrides:
handleCommentin classHTMLEditorKit.ParserCallback
-
handleStartTag
Equivalent to SaxstartElement- Overrides:
handleStartTagin classHTMLEditorKit.ParserCallback
-
handleEndTag
Equivalent to SaxendElement- Overrides:
handleEndTagin classHTMLEditorKit.ParserCallback
-
handleSimpleTag
Equivalent to SaxstartElementplusendElement- Overrides:
handleSimpleTagin classHTMLEditorKit.ParserCallback
-
handleError
Swing-HTML-parser template method, no ContentHandler equivalent. These errors are generally recoverable, so they are logged.- Overrides:
handleErrorin classHTMLEditorKit.ParserCallback
-