|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--net.xineo.xml.handler.ObjectHandler
|
+--net.xineo.xml.handler.ObjectHandlerAdapter
Provides a default implementation of ObjectHandler.
Two possible uses of this convenience class are availables:
ObjectHandlerInterface interface,
as weell as the implementation of the handlesElement(net.xineo.xml.util.ElementName) method,
given the handled element name in one of the following constructors:
ObjectHandlerAdapter(ObjectHandlerInterface) constructor.
| Constructor Summary | |
ObjectHandlerAdapter(ElementName handledElementName)
Creates an object handler adapter which will handle an element given by its name. |
|
ObjectHandlerAdapter(ObjectHandlerInterface delegate)
Creates an object handler adapter that will delegate all events to the given handler. |
|
ObjectHandlerAdapter(java.lang.String elementQName)
Creates an object handler adapter which will handle an element given by its name. |
|
ObjectHandlerAdapter(java.lang.String namespaceURI,
java.lang.String localName)
Creates an object handler adapter which will handle an element given by its name. |
|
| 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. |
ObjectHandlerInterface |
getDelegate()
|
ElementName |
getHandledElement()
Returns the handled element name. |
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. |
protected void |
setDelegate(ObjectHandlerInterface delegate)
|
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). |
| Methods inherited from class net.xineo.xml.handler.ObjectHandler |
addSubHandler, findHandlerByElementName, getAsContentHandler, getContext, getName, getParents, getUserContext, setUserContext, toString, transmitContext |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ObjectHandlerAdapter(java.lang.String elementQName)
elementQName - Qualified name of the handled element
public ObjectHandlerAdapter(java.lang.String namespaceURI,
java.lang.String localName)
namespaceURI - Namespace URI of the handled elementlocalName - Local name of the handled elementpublic ObjectHandlerAdapter(ElementName handledElementName)
handledElementName - Name of the handled elementpublic ObjectHandlerAdapter(ObjectHandlerInterface delegate)
delegate - The delegate object handler| Method Detail |
public ElementName getHandledElement()
public boolean handlesElement(ElementName elementName)
ObjectHandlerInterface
elementName - The name of the element to handle.
public void startElement(ElementName elementName,
org.xml.sax.Attributes attributes)
throws HandlerException
ObjectHandlerInterface
elementName - The name of the element that startsattributes - The attributes of the element that starts
HandlerException - If any error occurs
public void endElement(ElementName elementName,
java.lang.String characters)
throws HandlerException
ObjectHandlerInterface
elementName - The name of the element that endscharacters - Concatenation of all text contained in this element
HandlerException - If any error occurs
public void text(java.lang.String text)
throws HandlerException
ObjectHandlerInterface
HandlerException
public void initialize(org.xml.sax.Attributes attributes)
throws HandlerException
ObjectHandlerInterface
attributes - The attributes of the element that starts
HandlerException - If any error occurs
public void terminate(java.lang.String text)
throws HandlerException
ObjectHandlerInterface
text - Concatenation of all text contained in this element
HandlerException - If any error occurs
public void subHandlerInitialized(ObjectHandler subHandler)
throws HandlerException
ObjectHandlerInterface
subHandler - The initialized sub-handler
HandlerException - In any error occurs
public void subHandlerTerminated(ObjectHandler subHandler)
throws HandlerException
ObjectHandlerInterface
subHandler - The terminated sub-handler
HandlerException - If any error occurspublic ObjectHandlerInterface getDelegate()
protected void setDelegate(ObjectHandlerInterface delegate)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||