org.custommonkey.xmlunit

Class HTMLDocumentBuilder.SwingEvent2SaxAdapter

public class HTMLDocumentBuilder.SwingEvent2SaxAdapter extends ParserCallback

Adapts Swing HTML callback messages to Sax equivalents, passing them to a Sax-aware ContentHandler.
Constructor Summary
SwingEvent2SaxAdapter()
Default constructor
Method Summary
voidflush()
Swing-HTML-parser template method, no ContentHandler equivalent
voidhandleComment(char[] data, int pos)
Equivalent to Sax LexicalHandler comment method.
voidhandleEndTag(Tag tag, int pos)
Equivalent to Sax endElement
voidhandleError(String errorMsg, int pos)
Swing-HTML-parser template method, no ContentHandler equivalent.
voidhandleSimpleTag(Tag tag, MutableAttributeSet attributeSet, int pos)
Equivalent to Sax startElement plus endElement
voidhandleStartTag(Tag tag, MutableAttributeSet attributeSet, int pos)
Equivalent to Sax startElement
voidhandleText(char[] data, int pos)
Equivalent to Sax characters
voidparse(Reader reader, ContentHandler saxContentHandler)
Perform Swing-HTML-parse-event-to-Sax-event conversion

Constructor Detail

SwingEvent2SaxAdapter

public SwingEvent2SaxAdapter()
Default constructor

Method Detail

flush

public void flush()
Swing-HTML-parser template method, no ContentHandler equivalent

handleComment

public void handleComment(char[] data, int pos)
Equivalent to Sax LexicalHandler comment method. If the supplied ContentHandler is also an LexicalHandler then the cast will be made and the sax event passed on.

handleEndTag

public void handleEndTag(Tag tag, int pos)
Equivalent to Sax endElement

handleError

public void handleError(String errorMsg, int pos)
Swing-HTML-parser template method, no ContentHandler equivalent. These errors are generally recoverable, so they are logged.

handleSimpleTag

public void handleSimpleTag(Tag tag, MutableAttributeSet attributeSet, int pos)
Equivalent to Sax startElement plus endElement

handleStartTag

public void handleStartTag(Tag tag, MutableAttributeSet attributeSet, int pos)
Equivalent to Sax startElement

handleText

public void handleText(char[] data, int pos)
Equivalent to Sax characters

parse

public void parse(Reader reader, ContentHandler saxContentHandler)
Perform Swing-HTML-parse-event-to-Sax-event conversion