All LDAP Classes
Internal LDAP Classes

com.novell.ldap.util
Class LDAPXMLHandler

java.lang.Object
  extended by com.novell.ldap.util.LDAPXMLHandler
Direct Known Subclasses:
ValueXMLhandler

public class LDAPXMLHandler
extends java.lang.Object

This class is used to handle the deserialization events emitted by SAXEventMultiplexer. It is a variation of SAXEvents Handler, simplied for accessing specific required events only.

See Also:
SAXEventMultiplexer

Field Summary
private static int CHILDELEMENT
           
private  java.lang.String elementName
           
private static int END
           
private static int INIT
           
private  java.util.HashMap m_handler_map
           
private  LDAPXMLHandler parenthandler
           
private  java.lang.Object resultantObject
           
private static int START
           
private  int state
           
private  java.lang.String value
           
 
Constructor Summary
LDAPXMLHandler(java.lang.String ElementName, LDAPXMLHandler parent)
          Default Constructor with element name for this Handler and parent LDAPXMLHandler to be processed.
 
Method Summary
protected  void addValue(java.lang.String tag, java.lang.Object value)
          This method defines the generic adapter to be used by child elements to return the values of the processed Child Elements.
protected  void endElement()
          This method is used to signal the end of Element.
protected  java.lang.String getName()
          This method returns the Name of the Element to be handled by this LDAPXMLHandler.
 java.lang.Object getObject()
          This method returns the deserialize Object generated by this class.
protected  LDAPXMLHandler getParent()
          Returns the Parent LDAPXMLHandler.
protected  java.lang.String getValue()
          This method returns the Value stored in this element.
protected  void handleAttributes(org.xml.sax.Attributes attributes)
          This method is used to handle the Attributes associated with this Element.
protected  void initHandler()
          This method is used to initialize the Handler.
(package private)  LDAPXMLHandler nextHandler(java.lang.String childelementName)
          This method is used to access the child element's LDAPXMLHandler.
protected  void setchildelement(LDAPXMLHandler handler)
          Sets the Handler for the Child LDAPXMLHandler, it expects only one handler for each code base.
protected  void setObject(java.lang.Object data)
          This method is used to set the Deserialized Object and it also calls the parent LDAPXMLHandler (if not null), returning the value using addValue()
(package private)  void startElement()
          This method is called when a new element controlled by this handler is found.
(package private)  void value(java.lang.StringBuffer buf)
          This is used to handle the processing of the characters for the specific xml tags.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

elementName

private java.lang.String elementName

value

private java.lang.String value

parenthandler

private LDAPXMLHandler parenthandler

m_handler_map

private java.util.HashMap m_handler_map

state

private int state

INIT

private static final int INIT
See Also:
Constant Field Values

START

private static final int START
See Also:
Constant Field Values

CHILDELEMENT

private static final int CHILDELEMENT
See Also:
Constant Field Values

END

private static final int END
See Also:
Constant Field Values

resultantObject

private java.lang.Object resultantObject
Constructor Detail

LDAPXMLHandler

public LDAPXMLHandler(java.lang.String ElementName,
                      LDAPXMLHandler parent)
Default Constructor with element name for this Handler and parent LDAPXMLHandler to be processed.

Parameters:
ElementName - String name of the XML element to process.
parent - LDAPXMLHandler , which is the parent of this Element.
Method Detail

getParent

protected LDAPXMLHandler getParent()
Returns the Parent LDAPXMLHandler.

Returns:
LDAPHandler

nextHandler

LDAPXMLHandler nextHandler(java.lang.String childelementName)
This method is used to access the child element's LDAPXMLHandler. The events for the child elements would be pipelined to returned handler.

Parameters:
childelementName - The element name for the xml element.
Returns:
LDAPXMLHandler for the specific event.

startElement

final void startElement()
This method is called when a new element controlled by this handler is found.

See Also:
endElement()

value

final void value(java.lang.StringBuffer buf)
This is used to handle the processing of the characters for the specific xml tags.

Parameters:
buf - StringBuffer containing all the chars contained in this tag.

getName

protected final java.lang.String getName()
This method returns the Name of the Element to be handled by this LDAPXMLHandler.

Returns:
String xml element Name.

getValue

protected final java.lang.String getValue()
This method returns the Value stored in this element.

Returns:
String Value stored in this Element.

setchildelement

protected final void setchildelement(LDAPXMLHandler handler)
Sets the Handler for the Child LDAPXMLHandler, it expects only one handler for each code base.

Parameters:
handler - This handler for specific child element.

addValue

protected void addValue(java.lang.String tag,
                        java.lang.Object value)
This method defines the generic adapter to be used by child elements to return the values of the processed Child Elements.

Parameters:
tag - String XML tag.
value - Object deserialized value for the specific tag.

initHandler

protected void initHandler()
This method is used to initialize the Handler. It is expected that most of the implementation of this class would overide is method.


endElement

protected void endElement()
This method is used to signal the end of Element. It is expected that most of the implementation of this class would overide is method. and create the Objects from the deserialize data obtained so far.


handleAttributes

protected void handleAttributes(org.xml.sax.Attributes attributes)
                         throws org.xml.sax.SAXException
This method is used to handle the Attributes associated with this Element. It is expected that most of the implementation of this class would overide is method and do the required processing of the elements.

Parameters:
attributes - Attributes found with this element.
Throws:
org.xml.sax.SAXException - When the specific mandatory element is not found, so as to stop the processing.

getObject

public final java.lang.Object getObject()
This method returns the deserialize Object generated by this class.

Returns:
Object Deserialize form of XML tag.

setObject

protected final void setObject(java.lang.Object data)
This method is used to set the Deserialized Object and it also calls the parent LDAPXMLHandler (if not null), returning the value using addValue()

Parameters:
data - Object data.
See Also:
addValue(String, Object)

All LDAP Classes
Internal LDAP Classes

Copyright ? 2002 Novell, Inc. All Rights Reserved.
Novell, Inc.
1800 South Novell Place
Provo, Ut 84606
Phone: (801) 861-5000