org.progeeks.util.xml
Class JndiObjectHandler

java.lang.Object
  extended by org.progeeks.util.xml.AbstractObjectHandler
      extended by org.progeeks.util.xml.JndiObjectHandler
All Implemented Interfaces:
ObjectHandler

public class JndiObjectHandler
extends AbstractObjectHandler

An ObjectHandler that is used to lookup an Object in JNDI.

Version:
$Revision: 1.4 $
Author:
Aaron Lindsey

Field Summary
static java.lang.String HANDLER_TAG
          The default name of the tag this class will handle.
 
Constructor Summary
JndiObjectHandler()
           
JndiObjectHandler(java.lang.String handlerTag)
           
 
Method Summary
 boolean canHandle(java.lang.String tag)
          Returns true if this handler applies to the specified object tag.
 java.lang.Object createObject(java.lang.String tag, org.xml.sax.Attributes atts, ObjectXmlReader reader)
          Creates and returns an object based on the specified parameters.
 java.lang.Object getProperty(java.lang.Object obj, java.lang.String field, ObjectXmlReader reader)
          Returns the current value of the specified property in the specified object.
 java.lang.Class getPropertyClass(java.lang.Object obj, java.lang.String field, ObjectXmlReader reader)
          Returns the base type for the specified field.
 java.util.Collection getPropertyCollection(java.lang.Object obj, java.lang.String field, ObjectXmlReader reader)
          Returns the a collection for the specified field that can be used to accumulate multiple object values.
 void setProperty(java.lang.Object obj, java.lang.String field, java.lang.Object value, ObjectXmlReader reader)
          Sets a property on the specified object.
 void setTextProperty(java.lang.Object obj, java.lang.String field, java.lang.String value, ObjectXmlReader reader)
          Sets a text-value property on the specified object.
 
Methods inherited from class org.progeeks.util.xml.AbstractObjectHandler
resolveObject, setConfigurationProperty, setContainedText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HANDLER_TAG

public static final java.lang.String HANDLER_TAG
The default name of the tag this class will handle.

See Also:
Constant Field Values
Constructor Detail

JndiObjectHandler

public JndiObjectHandler()

JndiObjectHandler

public JndiObjectHandler(java.lang.String handlerTag)
Method Detail

canHandle

public boolean canHandle(java.lang.String tag)
Description copied from class: AbstractObjectHandler
Returns true if this handler applies to the specified object tag.

Specified by:
canHandle in interface ObjectHandler
Specified by:
canHandle in class AbstractObjectHandler

setProperty

public void setProperty(java.lang.Object obj,
                        java.lang.String field,
                        java.lang.Object value,
                        ObjectXmlReader reader)
Description copied from class: AbstractObjectHandler
Sets a property on the specified object.

Specified by:
setProperty in interface ObjectHandler
Specified by:
setProperty in class AbstractObjectHandler

setTextProperty

public void setTextProperty(java.lang.Object obj,
                            java.lang.String field,
                            java.lang.String value,
                            ObjectXmlReader reader)
Description copied from class: AbstractObjectHandler
Sets a text-value property on the specified object. The handler may do some internal conversions to translate into an appropriate type.

Specified by:
setTextProperty in interface ObjectHandler
Specified by:
setTextProperty in class AbstractObjectHandler

getPropertyClass

public java.lang.Class getPropertyClass(java.lang.Object obj,
                                        java.lang.String field,
                                        ObjectXmlReader reader)
Description copied from class: AbstractObjectHandler
Returns the base type for the specified field. This is used to determine whether or not to accumulate field values in a collection.

Specified by:
getPropertyClass in interface ObjectHandler
Specified by:
getPropertyClass in class AbstractObjectHandler

getPropertyCollection

public java.util.Collection getPropertyCollection(java.lang.Object obj,
                                                  java.lang.String field,
                                                  ObjectXmlReader reader)
Description copied from class: AbstractObjectHandler
Returns the a collection for the specified field that can be used to accumulate multiple object values. This is used when the XML field declaration specifies the progressive attribute.

Specified by:
getPropertyCollection in interface ObjectHandler
Specified by:
getPropertyCollection in class AbstractObjectHandler

getProperty

public java.lang.Object getProperty(java.lang.Object obj,
                                    java.lang.String field,
                                    ObjectXmlReader reader)
Returns the current value of the specified property in the specified object. This is used by the xml.existingValue directive and may eventually replace getPropertyCollection() as well.

Specified by:
getProperty in interface ObjectHandler
Specified by:
getProperty in class AbstractObjectHandler

createObject

public java.lang.Object createObject(java.lang.String tag,
                                     org.xml.sax.Attributes atts,
                                     ObjectXmlReader reader)
Description copied from class: AbstractObjectHandler
Creates and returns an object based on the specified parameters.

Specified by:
createObject in interface ObjectHandler
Specified by:
createObject in class AbstractObjectHandler


Copyright © 2002-2003 Paul Speed. All Rights Reserved.