net.xineo.xml.handler
Class VirtualHandler

java.lang.Object
  |
  +--net.xineo.xml.handler.ObjectHandler
        |
        +--net.xineo.xml.handler.ObjectHandlerAdapter
              |
              +--net.xineo.xml.handler.VirtualHandler
All Implemented Interfaces:
ObjectHandlerInterface

public class VirtualHandler
extends ObjectHandlerAdapter

This special handler is able to dynamically instantiate a delegate, and is usefull when a recursion in the schema would produce an infinite recursion during static instantiation of sub handlers. Note that this feature replaces the old "child handler" system.

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

Constructor Summary
VirtualHandler(ElementName handledElementName, java.lang.Class handlerClass)
          Creates a new virtual handler given the handled element name and the class of the associated object handler.
VirtualHandler(ElementName handledElementName, HandlerFactory handlerFactory)
          Creates a new virtual handler given the handled element name and the class of the associated object handler.
 
Method Summary
protected  ObjectHandler findHandlerByElementName(ElementName elementName)
          For internal use
 java.lang.String getName()
           
 void initialize(org.xml.sax.Attributes attributes)
          Called when a handled element starts.
 
Methods inherited from class net.xineo.xml.handler.ObjectHandlerAdapter
endElement, getDelegate, getHandledElement, handlesElement, setDelegate, startElement, subHandlerInitialized, subHandlerTerminated, terminate, text
 
Methods inherited from class net.xineo.xml.handler.ObjectHandler
addSubHandler, getAsContentHandler, getContext, getParents, getUserContext, setUserContext, toString, transmitContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VirtualHandler

public VirtualHandler(ElementName handledElementName,
                      java.lang.Class handlerClass)
Creates a new virtual handler given the handled element name and the class of the associated object handler.

Parameters:
handledElementName - The handled element name
handlerClass - The class of the object handler, that will be instanciated to handle elements of the given name

VirtualHandler

public VirtualHandler(ElementName handledElementName,
                      HandlerFactory handlerFactory)
Creates a new virtual handler given the handled element name and the class of the associated object handler.

Parameters:
handledElementName - The handled element name
Method Detail

getName

public java.lang.String getName()
Overrides:
getName in class ObjectHandler

initialize

public void initialize(org.xml.sax.Attributes attributes)
                throws HandlerException
Description copied from interface: ObjectHandlerInterface
Called when a handled element starts.

Specified by:
initialize in interface ObjectHandlerInterface
Overrides:
initialize in class ObjectHandlerAdapter
Parameters:
attributes - The attributes of the element that starts
Throws:
HandlerException - If any error occurs

findHandlerByElementName

protected ObjectHandler findHandlerByElementName(ElementName elementName)
Description copied from class: ObjectHandler
For internal use

Overrides:
findHandlerByElementName in class ObjectHandler


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