org.enhydra.xml.xmlc.html.parsers.swing
Class SwingParser

java.lang.Object
  |
  +--javax.swing.text.html.HTMLEditorKit.ParserCallback
        |
        +--org.enhydra.xml.xmlc.html.parsers.swing.SwingParser

class SwingParser
extends HTMLEditorKit.ParserCallback

Interface to the Swing HTML parser. This attempts to correct problem with using the SWING HTML 3.2 parser to parse HTML 4.0 constructs and well as general bugginess in the Swing parser.

The known Swing problems are:


Inner Class Summary
(package private)  class SwingParser.ParserError
          Error thrown to stop parser.
 
Fields inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
IMPLIED
 
Constructor Summary
(package private) SwingParser()
           
 
Method Summary
(package private) static void ()
          Static constructor.
 void flush()
           
 void handleComment(char[] data, int pos)
          Swing comment handler.
 void handleEndTag(HTML.Tag tag, int pos)
          Swing end tag start handler.
 void handleError(String errorMsg, int pos)
          Swing parser error handler that tries to manage the message generated by parser that should really be ignored.
 void handleSimpleTag(HTML.Tag tag, MutableAttributeSet attrSet, int pos)
          Swing simple tag start handler.
 void handleStartTag(HTML.Tag tag, MutableAttributeSet attrSet, int pos)
          Swing tag start handler.
 void handleText(char[] data, int pos)
          Swing text handler.
(package private)  void parse(HTMLDocBuilder docBuilder, ErrorReporter errorReporter, ParseTracer tracer, Reader input, LineNumberMap lineNumberMap)
          Parse a file into a DOM.
 
Methods inherited from class javax.swing.text.html.HTMLEditorKit.ParserCallback
handleEndOfLineString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingParser

SwingParser()
Method Detail

static void ()
Static constructor.

parse

void parse(HTMLDocBuilder docBuilder,
           ErrorReporter errorReporter,
           ParseTracer tracer,
           Reader input,
           LineNumberMap lineNumberMap)
     throws XMLCException,
            IOException
Parse a file into a DOM.

flush

public void flush()
           throws BadLocationException
Overrides:
flush in class HTMLEditorKit.ParserCallback

handleText

public void handleText(char[] data,
                       int pos)
Swing text handler.
Overrides:
handleText in class HTMLEditorKit.ParserCallback
See Also:
HTMLEditorKit.ParserCallback.handleText(char[], int)

handleComment

public void handleComment(char[] data,
                          int pos)
Swing comment handler.
Overrides:
handleComment in class HTMLEditorKit.ParserCallback
See Also:
HTMLEditorKit.ParserCallback.handleComment(char[], int)

handleStartTag

public void handleStartTag(HTML.Tag tag,
                           MutableAttributeSet attrSet,
                           int pos)
Swing tag start handler.
Overrides:
handleStartTag in class HTMLEditorKit.ParserCallback
See Also:
HTMLEditorKit.ParserCallback.handleStartTag(javax.swing.text.html.HTML.Tag, javax.swing.text.MutableAttributeSet, int)

handleEndTag

public void handleEndTag(HTML.Tag tag,
                         int pos)
Swing end tag start handler.
Overrides:
handleEndTag in class HTMLEditorKit.ParserCallback
See Also:
HTMLEditorKit.ParserCallback.handleEndTag(javax.swing.text.html.HTML.Tag, int)

handleSimpleTag

public void handleSimpleTag(HTML.Tag tag,
                            MutableAttributeSet attrSet,
                            int pos)
Swing simple tag start handler.
Overrides:
handleSimpleTag in class HTMLEditorKit.ParserCallback
See Also:
HTMLEditorKit.ParserCallback.handleSimpleTag(javax.swing.text.html.HTML.Tag, javax.swing.text.MutableAttributeSet, int)

handleError

public void handleError(String errorMsg,
                        int pos)
Swing parser error handler that tries to manage the message generated by parser that should really be ignored.
Overrides:
handleError in class HTMLEditorKit.ParserCallback
See Also:
HTMLEditorKit.ParserCallback.handleError(java.lang.String, int)


Copyright © 1999-2002 enhydra.org (Mark Diekhans, David Li, Richard Kunze). All Rights reserved.