net.xineo.xml.handler
Interface ObjectHandlerInterface

All Known Implementing Classes:
ObjectHandler

public interface ObjectHandlerInterface

This interface defines the methods that have to be implementd by any object handler. These methods will be called when parsing the XML document, and must contain your XML data handling code. If you don't need th handle all the events defined in the interface, you may want to use the ObjectHandlerAdapter convenience class.

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

Method Summary
 void endElement(ElementName elementName, java.lang.String characters)
          This method is called when an element which is not handled by a sub-handler ends.
 boolean handlesElement(ElementName elementName)
          Must return true if and only if this handler is able to handle elements designed by the given name.
 void initialize(org.xml.sax.Attributes attributes)
          Called when a handled element starts.
 void startElement(ElementName elementName, org.xml.sax.Attributes attributes)
          This method is called when an element which is not handled by a sub-handler starts.
 void subHandlerInitialized(ObjectHandler subHandler)
          Called when a sub-handler is about to be initialized
 void subHandlerTerminated(ObjectHandler subHandler)
          Called when a sub-handler is about to be terminated
 void terminate(java.lang.String text)
          Called when a handled element ends.
 void text(java.lang.String text)
          Called when text is found (a la SAX).
 

Method Detail

handlesElement

public boolean handlesElement(ElementName elementName)
Must return true if and only if this handler is able to handle elements designed by the given name.

Parameters:
elementName - The name of the element to handle.
Returns:
True if this handler can handle it

startElement

public void startElement(ElementName elementName,
                         org.xml.sax.Attributes attributes)
                  throws HandlerException
This method is called when an element which is not handled by a sub-handler starts.

Parameters:
elementName - The name of the element that starts
attributes - The attributes of the element that starts
Throws:
HandlerException - If any error occurs

endElement

public void endElement(ElementName elementName,
                       java.lang.String characters)
                throws HandlerException
This method is called when an element which is not handled by a sub-handler ends.

Parameters:
elementName - The name of the element that ends
characters - Concatenation of all text contained in this element
Throws:
HandlerException - If any error occurs

text

public void text(java.lang.String text)
          throws HandlerException
Called when text is found (a la SAX). Note that the concatenation of all text contained in elements is also passed to the terminate() method.

HandlerException

initialize

public void initialize(org.xml.sax.Attributes attributes)
                throws HandlerException
Called when a handled element starts.

Parameters:
attributes - The attributes of the element that starts
Throws:
HandlerException - If any error occurs

terminate

public void terminate(java.lang.String text)
               throws HandlerException
Called when a handled element ends.

Parameters:
text - Concatenation of all text contained in this element
Throws:
HandlerException - If any error occurs

subHandlerInitialized

public void subHandlerInitialized(ObjectHandler subHandler)
                           throws HandlerException
Called when a sub-handler is about to be initialized

Parameters:
subHandler - The initialized sub-handler
Throws:
HandlerException - In any error occurs

subHandlerTerminated

public void subHandlerTerminated(ObjectHandler subHandler)
                          throws HandlerException
Called when a sub-handler is about to be terminated

Parameters:
subHandler - The terminated sub-handler
Throws:
HandlerException - If any error occurs


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