org.oddjob.arooa.handlers
Class MainHandler

java.lang.Object
  extended byorg.oddjob.arooa.ArooaHandler
      extended byorg.oddjob.arooa.handlers.MainHandler

public class MainHandler
extends ArooaHandler

The first handler to be called. This will recieve only an onStartChild with the document root as the child element.

If the document tag is specified this handler will verify the name of the element root against the document tag.

The startHandler is provided to Arooa as the handler for dealing with this document element. Thus the startHandler can then process the docment element in it's onStartElement method as per the typical pattern of an ArooaHandler.

See Also:
ArooaHandler.
Author:
Rob Gordon.

Constructor Summary
MainHandler(ArooaHandler startHandler)
          /** Constructor.
MainHandler(java.lang.String documentTag, ArooaHandler startHandler)
          Constructor.
 
Method Summary
 ArooaHandler onStartChild(java.lang.String uri, java.lang.String name, java.lang.String qname, org.xml.sax.Attributes attrs, ArooaContext context)
          Handle the top level element.
 
Methods inherited from class org.oddjob.arooa.ArooaHandler
characters, checkNamespace, onEndChild, onEndElement, onStartElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MainHandler

public MainHandler(ArooaHandler startHandler)
/** Constructor.


MainHandler

public MainHandler(java.lang.String documentTag,
                   ArooaHandler startHandler)
Constructor.

Parameters:
documentTag - The document tag which will be validated against the top level element if not null.
Method Detail

onStartChild

public ArooaHandler onStartChild(java.lang.String uri,
                                 java.lang.String name,
                                 java.lang.String qname,
                                 org.xml.sax.Attributes attrs,
                                 ArooaContext context)
                          throws org.xml.sax.SAXParseException
Handle the top level element.

Overrides:
onStartChild in class ArooaHandler
Parameters:
uri - The namespace uri.
name - The element tag.
qname - The element qualified name.
attrs - The attributes of the element.
context - The current context.
Returns:
The handler that handles the top level elelement.
Throws:
org.xml.sax.SAXParseException - if the qualified name is not "project".