superwaba.ext.xplat.xml
Interface ContentHandler

All Known Implementing Classes:
XmlRpcContentHandler

public interface ContentHandler

Receive notification of the logical content of a document.

Note: While in the SAX 2.0 spirit, this implementation is not fully compliant.  Speed and footprint took precedence over what the author judged being details.

This is the main interface that most SAX applications implement: if the application needs to be informed of basic parsing events, it implements this interface and registers an instance with the XML reader using the XmlReader.setContentHandler(superwaba.ext.xplat.xml.ContentHandler) setContentHandler} method. The XML reader uses the instance to report basic document-related events like the start and end of elements and character data.

The order of events in this interface is very important, and mirrors the order of information in the document itself. For example, all of an element's content (character data, processing instructions, and/or subelements) will appear, in order, between the startElement event and the corresponding endElement event.


Method Summary
 void characters(java.lang.String s)
          Receive notification of character data.
 void comment(java.lang.String s)
          Receive notification of comment data.
 void endElement(int tag)
          Receive notification of the end of an element.
 void startElement(int tag, AttributeList atts)
          Receive notification of the beginning of an element.
 

Method Detail

startElement

public void startElement(int tag,
                         AttributeList atts)
Receive notification of the beginning of an element.

The XmlReader will invoke this method at the beginning of every element in the XML document; there will be a corresponding endElement event for every startElement event (even when the element is empty). All of the element's content will be reported, in order, before the corresponding endElement event.

Parameters:
tag - tag identifier for this element
atts - The attributes list attached to the element.

endElement

public void endElement(int tag)
Receive notification of the end of an element.

The XMLReader will invoke this method at the end of every element in the XML document; there will be a corresponding startElement event for every endElement event (even when the element is empty).

Parameters:
tag - tag identifier for this element

characters

public void characters(java.lang.String s)
Receive notification of character data.

The XMLReader will call this method to report each chunk of character data. This XMLReader implementation return all contiguous character data in a single chunk.

Parameters:
s - The string of characters from the XML document.

comment

public void comment(java.lang.String s)
Receive notification of comment data.

The XMLReader will call this method to report each chunk of comments. This XMLReader implementation return all contiguous comment data in a single chunk.

Parameters:
s - The string of characters from the XML document.