com.echomine.jabber
Class JabberContentHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by com.echomine.jabber.JabberContentHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class JabberContentHandler
extends org.xml.sax.helpers.DefaultHandler

The main content handler used by the protocol itself. It essentially acts as a delegator. When an element comes in, it will automatically look for the required parser that is able to parse the contents of the message and then pass along all the incoming callbacks to it.


Constructor Summary
JabberContentHandler(JabberSession session, JabberMessageReceiver receiver, MessageRequestQueue queue, JabberMessageHandler msgHandler)
           
 
Method Summary
 void characters(char[] ch, int start, int length)
           
 void endDocument()
          This method only handled by the protocol itself and is never sent to the higher level
 void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
          ending the element essentially "resets" our delegation back to us
 void startDocument()
          This method is only handled by the protocol itself and is never sent to the higher level
 void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attr)
          check to see if there is a handler for this message.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JabberContentHandler

public JabberContentHandler(JabberSession session,
                            JabberMessageReceiver receiver,
                            MessageRequestQueue queue,
                            JabberMessageHandler msgHandler)
Method Detail

startDocument

public void startDocument()
This method is only handled by the protocol itself and is never sent to the higher level

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler

endDocument

public void endDocument()
This method only handled by the protocol itself and is never sent to the higher level

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attr)
check to see if there is a handler for this message. If so, delegate the rest of the parsing to this element until the end of the element is reached. At that point, we are back to selecting and delegating.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String localName,
                       java.lang.String qName)
ending the element essentially "resets" our delegation back to us

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler

characters

public void characters(char[] ch,
                       int start,
                       int length)
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler


Copyright © 2001-2005 Echomine. All Rights Reserved.