org.jabber.jabberbeans.sax
Class XMLStreamDocumentHandler

java.lang.Object
  |
  +--org.jabber.jabberbeans.sax.SubHandler
        |
        +--org.jabber.jabberbeans.sax.XMLStreamDocumentHandler

public class XMLStreamDocumentHandler
extends SubHandler

Main (top level) handler given to a SAX-enabled parser.

Version:
$Revision: 1.1.1.1 $
Author:
David Waite <dwaite@jabber.com>, $Author: lucky $

Field Summary
protected  ConnectionBean.InputStreamInterface isi
          instantiating handler, used for sending messages back up the pipe.
 
Fields inherited from class org.jabber.jabberbeans.sax.SubHandler
handlerFactory, parent, parser, subCount
 
Constructor Summary
XMLStreamDocumentHandler()
          Creates a new XMLStreamDocumentHandler instance.
 
Method Summary
 void handleEndElement(java.lang.String name)
          handleEndElement method catches and calls disconnect.
 void handleStartElement(java.lang.String name, AttributeList attributes)
          handle the start of an element, including finding an appropriate handler for the element or namespace type
 void receiveChildData(SubHandler subHandler, java.lang.Object p)
          receiveChildData receives packets constructed by the subordinate handlers, and shuttles it to the protocol handler
 void setPacketHandler(ConnectionBean.InputStreamInterface isi)
          set the InputStreamInterface, used to inform client code of new received data.
 java.lang.Object stopHandler(java.lang.String name)
          stopHandler returns null since there is no 'data' returned which was not already sent via the 'receive' method.
 
Methods inherited from class org.jabber.jabberbeans.sax.SubHandler
characters, endDocument, endElement, getHandlerFactory, getSubCount, graftParent, graftSubHandler, ignorableWhitespace, processingInstruction, setChildSubHandler, setDocumentLocator, setHandlerFactory, setParent, setParser, startDocument, startElement, startHandler
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

isi

protected ConnectionBean.InputStreamInterface isi
instantiating handler, used for sending messages back up the pipe.
Constructor Detail

XMLStreamDocumentHandler

public XMLStreamDocumentHandler()
Creates a new XMLStreamDocumentHandler instance.
Method Detail

setPacketHandler

public final void setPacketHandler(ConnectionBean.InputStreamInterface isi)
set the InputStreamInterface, used to inform client code of new received data.
Parameters:
isi - ConnectionBean.InputStreamInterface

handleStartElement

public void handleStartElement(java.lang.String name,
                               AttributeList attributes)
                        throws SAXException
handle the start of an element, including finding an appropriate handler for the element or namespace type
Overrides:
handleStartElement in class SubHandler
Parameters:
name - element name
attributes - element attributes
Throws:
SAXException - unknown root element, or XML parsing error

handleEndElement

public final void handleEndElement(java.lang.String name)
                            throws SAXException
handleEndElement method catches and calls disconnect.
Overrides:
handleEndElement in class SubHandler
Parameters:
name - a String value
Throws:
SAXException - if an error occurs

receiveChildData

public void receiveChildData(SubHandler subHandler,
                             java.lang.Object p)
                      throws SAXException
receiveChildData receives packets constructed by the subordinate handlers, and shuttles it to the protocol handler
Overrides:
receiveChildData in class SubHandler
Parameters:
subHandler - a SubHandler value of the handler the data came from, unused
p - an Object value, a Packet
Throws:
SAXException - if the data is invalid (i.e. null)

stopHandler

public final java.lang.Object stopHandler(java.lang.String name)
                                   throws SAXException
stopHandler returns null since there is no 'data' returned which was not already sent via the 'receive' method.
Overrides:
stopHandler in class SubHandler
Returns:
an Object value, unused.
Throws:
SAXException - if an error occurs