hotsax.html.sax
Interface ParserDelegate

All Known Implementing Classes:
DebugParserDelegate, SaxHandlerDelegate

public interface ParserDelegate

ParserDelegate - provides a clean interface between the Byacc/J generated HtmlParse and the SaxParser. This cleanly separates what is to be done from actually doing it. A HtmlParser can be combined with a DOM or SAX backend.


Method Summary
 void addAttribute(String name, String value)
          Adds an attribute to the list.
 void characters(HtmlParserVal lval)
          collect characters from parse stream.
 void comment(HtmlParserVal lval)
          comment handler Note, these are delegate to the XMLReader's LexicalHandler if any
 void endCDATA()
          CDATA handler Note, these are delegate to the XMLReader's LexicalHandler if any This only marks the end boundary of the CDATA section.
 void endDocument()
          Fire endDocument event.
 void endDTD()
          End the DOCTYPE declaration
 void endElement(HtmlParserVal lval)
          Fire endElement event.
 HtmlParserVal getAttributes()
           
 void processingInstruction(HtmlParserVal target, HtmlParserVal lval)
          Parse a PI and pass it to the contentHandler event (does not pass xml declaration: ) Separates the target from the data by using whitespace.
 void setXMLReader(XMLReader reader)
          Set the the XMLReader this delegate is reading from
 void startCDATA()
          CDATA handler Note, these are delegate to the XMLReader's LexicalHandler if any This only marks the start boundary condition.
 void startDocument()
          Parse a startDocument event and pass it to the resigtered content handler.
 void startDTD(HtmlParserVal lval)
          Start the beginning of the DOCTYPE (DTD) declaration Note, these are delegate to the XMLReader's LexicalHandler if any
 void startElement()
          Initialize the start of a start element.
 void startElement(HtmlParserVal lval)
          Fire startElement event.
 void startElement(HtmlParserVal lval, HtmlParserVal attrList)
           
 

Method Detail

startDocument

void startDocument()
Parse a startDocument event and pass it to the resigtered content handler. This method fires in response to a HtmlParser.EOF lexer token beging recognised. SOF is a virtual token fired as the first event after the file is opened.


processingInstruction

void processingInstruction(HtmlParserVal target,
                           HtmlParserVal lval)
Parse a PI and pass it to the contentHandler event (does not pass xml declaration: ) Separates the target from the data by using whitespace.


startElement

void startElement()
Initialize the start of a start element. Prepares the attribute list to collect any attributes.


addAttribute

void addAttribute(String name,
                  String value)
Adds an attribute to the list. The name of the attribute is normalized to lowercase


getAttributes

HtmlParserVal getAttributes()

startElement

void startElement(HtmlParserVal lval,
                  HtmlParserVal attrList)

startElement

void startElement(HtmlParserVal lval)
Fire startElement event. Note handled the actual beginning of the element by now and have collected all attributes (if any)


characters

void characters(HtmlParserVal lval)
collect characters from parse stream. Unwrap the HtmlParserVal.sval String to a character array.


endElement

void endElement(HtmlParserVal lval)
Fire endElement event. The name of the element is passed to the event handler. Note these might be optionally missing in the HTML case.


endDocument

void endDocument()
Fire endDocument event.


comment

void comment(HtmlParserVal lval)
comment handler Note, these are delegate to the XMLReader's LexicalHandler if any


startCDATA

void startCDATA()
CDATA handler Note, these are delegate to the XMLReader's LexicalHandler if any This only marks the start boundary condition. Text still goes through characters()


endCDATA

void endCDATA()
CDATA handler Note, these are delegate to the XMLReader's LexicalHandler if any This only marks the end boundary of the CDATA section. Text still goes through characters()


startDTD

void startDTD(HtmlParserVal lval)
Start the beginning of the DOCTYPE (DTD) declaration Note, these are delegate to the XMLReader's LexicalHandler if any

Parameters:
lval - HtmlParserVal represents the document type handle, system id or public id from the DOCTYPE declaration

endDTD

void endDTD()
End the DOCTYPE declaration


setXMLReader

void setXMLReader(XMLReader reader)
Set the the XMLReader this delegate is reading from

Parameters:
reader - the XMLReader or really the current SAXParser


Copyright © 2007-2008. All Rights Reserved.