|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jabber.jabberbeans.sax.SubHandler | +--org.jabber.jabberbeans.sax.PacketSubHandler
PacketSubHandler, which provides a framework to subclass for handling base packet types.
Field Summary | |
protected PacketBuilder |
builder
Builder class for packet types |
protected java.lang.StringBuffer |
elementChars
Buffer for holding characters between elements. |
Constructor Summary | |
PacketSubHandler()
Construct a new PacketSubHandler class.Derived in subclasses. |
Method Summary | |
void |
characters(char[] ch,
int start,
int length)
Report data characters seen by parser. |
protected void |
handleEndElement(java.lang.String name)
This is an exact copy of the end element in the main handler |
protected void |
handleStartElement(java.lang.String name,
AttributeList attributes)
This is an exact copy of the start element in the main handler. |
protected void |
packetEndElement(java.lang.String name)
handleEndElement is a wrapper to let a class derived from
this class handle custom element types. |
protected boolean |
packetStartElement(java.lang.String name,
AttributeList attributes)
packetStartElement is a method for handling additional
element types not defined in the base packet type. |
protected void |
packetStartHandler(java.lang.String name,
AttributeList attributes)
packetStartHandler is overloaded by subclasses to initialize
additional attributes. |
protected void |
receiveChildData(SubHandler subhandler,
java.lang.Object data)
called when a child object returns data (via its stopHandler() method) |
protected void |
startHandler(java.lang.String name,
AttributeList attributes)
startHandler is called on the first element handled by
the class. |
protected java.lang.Object |
stopHandler(java.lang.String name)
called as the handler is losing scope, to return any data it has created based on the XML it has been fed. |
Methods inherited from class org.jabber.jabberbeans.sax.SubHandler |
endDocument, endElement, getHandlerFactory, getSubCount, graftParent, graftSubHandler, ignorableWhitespace, processingInstruction, setChildSubHandler, setDocumentLocator, setHandlerFactory, setParent, setParser, startDocument, startElement |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected PacketBuilder builder
protected java.lang.StringBuffer elementChars
Constructor Detail |
public PacketSubHandler()
Method Detail |
protected final void handleStartElement(java.lang.String name, AttributeList attributes) throws SAXException
handleStartElement
in class SubHandler
name
- string that holds the element nameattributes
- AttributeList of attributes going with this element
SAXException
- thrown on error (unexpected element)protected boolean packetStartElement(java.lang.String name, AttributeList attributes) throws SAXException
packetStartElement
is a method for handling additional
element types not defined in the base packet type. It is addElement
after being filtered.
boolean
value of false if the tag should be
referred to the extension factory. Basically a 'handled' bit.
SAXException
- if an error occursprotected final void startHandler(java.lang.String name, AttributeList attributes) throws SAXException
startHandler
is called on the first element handled by
the class.
This implementation sets up the builder, clears the element character
cache, and parsers attributes to pull in the base attribute data.
startHandler
in class SubHandler
name
- element nameattributes
- list of attributes
SAXException
protected void packetStartHandler(java.lang.String name, AttributeList attributes)
packetStartHandler
is overloaded by subclasses to initialize
additional attributes.
name
- a String
valueattributes
- an AttributeList
valuepublic final void characters(char[] ch, int start, int length) throws SAXException
characters
in interface DocumentHandler
characters
in class SubHandler
ch
- character arraystart
- offset into character arraylength
- lenght of characters to pull from array
SAXException
- thrown on errorprotected final void handleEndElement(java.lang.String name) throws SAXException
handleEndElement
in class SubHandler
name
- string holding the element name
SAXException
- thrown on errorprotected void packetEndElement(java.lang.String name) throws SAXException
handleEndElement
is a wrapper to let a class derived from
this class handle custom element types.
name
- a String
value holding the element name
SAXException
- if an error occursprotected final java.lang.Object stopHandler(java.lang.String name) throws SAXException
stopHandler
in class SubHandler
name
- element name
SAXException
- in the event of XML parsing errors, or
errors detected in the building process for creating the
child data.protected final void receiveChildData(SubHandler subhandler, java.lang.Object data)
receiveChildData
in class SubHandler
subhandler
- SubHandler which is returning datadata
- Object being returned (parent is assumed to know how to
subclass because it created the child)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |