Package org.custommonkey.xmlunit
Class HTMLDocumentBuilder.SwingEvent2SaxAdapter
- java.lang.Object
-
- javax.swing.text.html.HTMLEditorKit.ParserCallback
-
- org.custommonkey.xmlunit.HTMLDocumentBuilder.SwingEvent2SaxAdapter
-
- Enclosing class:
- HTMLDocumentBuilder
public class HTMLDocumentBuilder.SwingEvent2SaxAdapter extends javax.swing.text.html.HTMLEditorKit.ParserCallback
Adapts Swing HTML callback messages to Sax equivalents, passing them to a Sax-aware ContentHandler.
-
-
Constructor Summary
Constructors Constructor Description SwingEvent2SaxAdapter()
Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
flush()
Swing-HTML-parser template method, no ContentHandler equivalentvoid
handleComment(char[] data, int pos)
Equivalent to Sax LexicalHandlercomment
method.void
handleEndTag(javax.swing.text.html.HTML.Tag tag, int pos)
Equivalent to SaxendElement
void
handleError(java.lang.String errorMsg, int pos)
Swing-HTML-parser template method, no ContentHandler equivalent.void
handleSimpleTag(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attributeSet, int pos)
Equivalent to SaxstartElement
plusendElement
void
handleStartTag(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attributeSet, int pos)
Equivalent to SaxstartElement
void
handleText(char[] data, int pos)
Equivalent to Saxcharacters
void
parse(java.io.Reader reader, org.xml.sax.ContentHandler saxContentHandler)
Perform Swing-HTML-parse-event-to-Sax-event conversion
-
-
-
Method Detail
-
parse
public void parse(java.io.Reader reader, org.xml.sax.ContentHandler saxContentHandler) throws org.xml.sax.SAXException, java.io.IOException
Perform Swing-HTML-parse-event-to-Sax-event conversion- Throws:
org.xml.sax.SAXException
java.io.IOException
-
flush
public void flush() throws javax.swing.text.BadLocationException
Swing-HTML-parser template method, no ContentHandler equivalent- Overrides:
flush
in classjavax.swing.text.html.HTMLEditorKit.ParserCallback
- Throws:
javax.swing.text.BadLocationException
-
handleText
public void handleText(char[] data, int pos)
Equivalent to Saxcharacters
- Overrides:
handleText
in classjavax.swing.text.html.HTMLEditorKit.ParserCallback
-
handleComment
public void handleComment(char[] data, int pos)
Equivalent to Sax LexicalHandlercomment
method. If the supplied ContentHandler is also an LexicalHandler then the cast will be made and the sax event passed on.- Overrides:
handleComment
in classjavax.swing.text.html.HTMLEditorKit.ParserCallback
-
handleStartTag
public void handleStartTag(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attributeSet, int pos)
Equivalent to SaxstartElement
- Overrides:
handleStartTag
in classjavax.swing.text.html.HTMLEditorKit.ParserCallback
-
handleEndTag
public void handleEndTag(javax.swing.text.html.HTML.Tag tag, int pos)
Equivalent to SaxendElement
- Overrides:
handleEndTag
in classjavax.swing.text.html.HTMLEditorKit.ParserCallback
-
handleSimpleTag
public void handleSimpleTag(javax.swing.text.html.HTML.Tag tag, javax.swing.text.MutableAttributeSet attributeSet, int pos)
Equivalent to SaxstartElement
plusendElement
- Overrides:
handleSimpleTag
in classjavax.swing.text.html.HTMLEditorKit.ParserCallback
-
handleError
public void handleError(java.lang.String errorMsg, int pos)
Swing-HTML-parser template method, no ContentHandler equivalent. These errors are generally recoverable, so they are logged.- Overrides:
handleError
in classjavax.swing.text.html.HTMLEditorKit.ParserCallback
-
-