net.xineo.xml.handler
Class ObjectHandler

java.lang.Object
  |
  +--net.xineo.xml.handler.ObjectHandler
All Implemented Interfaces:
ObjectHandlerInterface
Direct Known Subclasses:
ObjectHandlerAdapter, RootHandler

public abstract class ObjectHandler
extends java.lang.Object
implements ObjectHandlerInterface

Implements the core of an object handler, and must be subclassed to implement the ObjectHandlerInterface interface.

Version:
1.0
Author:
Fr�d�rik Bilhaut
See Also:
ObjectHandlerAdapter, ObjectHandlerInterface

Constructor Summary
ObjectHandler()
           
 
Method Summary
 void addSubHandler(ObjectHandler subHandler)
          Adds a sub-handler, that will handle elements embeded in the elements handled by this object handler.
protected  ObjectHandler findHandlerByElementName(ElementName elementName)
          For internal use
 org.xml.sax.ContentHandler getAsContentHandler()
          Returns a ContentHandler instance, which may be passed to an XML reader in order to parse XML documents with this object handler acting as the root handler.
protected  ElementNameStack getContext()
          Returns the current parsing context, represented as a stack containing the consitutive elements of the current branch of the XML tree.
 java.lang.String getName()
           
protected  java.util.Collection getParents()
          Returns the parents of this object handler, that are the handlers for which this handler is registered as a child handler (usually only one).
protected  java.lang.Object getUserContext()
          Returns the user context.
 void setUserContext(java.lang.Object userContext)
          Sets the user context of this object handler, which will be transmitted to all its sub-handlers during parsing, and will be available via the getUserContext() method.
 java.lang.String toString()
           
protected  void transmitContext(ObjectHandler subHandler)
          For internal use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.xineo.xml.handler.ObjectHandlerInterface
endElement, handlesElement, initialize, startElement, subHandlerInitialized, subHandlerTerminated, terminate, text
 

Constructor Detail

ObjectHandler

public ObjectHandler()
Method Detail

addSubHandler

public void addSubHandler(ObjectHandler subHandler)
Adds a sub-handler, that will handle elements embeded in the elements handled by this object handler.

Parameters:
subHandler - The sub-handler to be added.

setUserContext

public void setUserContext(java.lang.Object userContext)
Sets the user context of this object handler, which will be transmitted to all its sub-handlers during parsing, and will be available via the getUserContext() method.

Parameters:
userContext - Any object to be used as the user context.
See Also:
getUserContext()

getAsContentHandler

public org.xml.sax.ContentHandler getAsContentHandler()
Returns a ContentHandler instance, which may be passed to an XML reader in order to parse XML documents with this object handler acting as the root handler.

Returns:
This handler as a SAX content handler.

getName

public java.lang.String getName()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getUserContext

protected java.lang.Object getUserContext()
Returns the user context.

Returns:
The user context.
See Also:
setUserContext(java.lang.Object)

getContext

protected ElementNameStack getContext()
Returns the current parsing context, represented as a stack containing the consitutive elements of the current branch of the XML tree.

Returns:
The current context.

getParents

protected java.util.Collection getParents()
Returns the parents of this object handler, that are the handlers for which this handler is registered as a child handler (usually only one). The returned collection is unmodifiable.

Returns:
The parent handler(s).

findHandlerByElementName

protected ObjectHandler findHandlerByElementName(ElementName elementName)
For internal use


transmitContext

protected void transmitContext(ObjectHandler subHandler)
For internal use



Copyright © 2002 Frédérik Bilhaut - Xineo.NET