com.ca.commons.jndi.beans
Class URIPropertyHandler

java.lang.Object
  extended by com.ca.commons.jndi.beans.URIPropertyHandler
All Implemented Interfaces:
JNDIBeanPropertyHandler

public final class URIPropertyHandler
extends Object
implements JNDIBeanPropertyHandler


Field Summary
static Logger logger
           
 
Constructor Summary
URIPropertyHandler()
           
 
Method Summary
 List getAttributeValues(Object value)
          Converts a Java Bean property value into one or more JNDI attribute values.
 Object getPropertyValue(Attribute[] attr)
          Converts a list of JNDI attributes into an object suitable for a Java Bean property value.
 void init(Properties props)
          Provides a set of properties to initialize the handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static final Logger logger
Constructor Detail

URIPropertyHandler

public URIPropertyHandler()
Method Detail

init

public void init(Properties props)
Description copied from interface: JNDIBeanPropertyHandler
Provides a set of properties to initialize the handler. A handler implementation may alter aspects of its behaviour based on these properties. Each implementation must document what properties it expects (if any). This method is called once on each handler instance by JNDIBeanStoreFactory with the properties listed by its XML configuration data.

Specified by:
init in interface JNDIBeanPropertyHandler
Parameters:
props - The properties to use for initialization.

getPropertyValue

public Object getPropertyValue(Attribute[] attr)
                        throws NamingException,
                               JNDIBeanStoreException
Description copied from interface: JNDIBeanPropertyHandler
Converts a list of JNDI attributes into an object suitable for a Java Bean property value. The handler implementation must document the number and nature of the attributes that it expects, as well as the type of the returned value. The Attributes in the array will appear in the order specified in the XML mapping.

Specified by:
getPropertyValue in interface JNDIBeanPropertyHandler
Parameters:
attr - An array of JNDI attributes.
Returns:
An object of a type defined by the implementing class.
Throws:
NamingException - If an attribute's values could not be read.
JNDIBeanStoreException - If the attribute values could not be processed.

getAttributeValues

public List getAttributeValues(Object value)
                        throws JNDIBeanStoreException
Description copied from interface: JNDIBeanPropertyHandler
Converts a Java Bean property value into one or more JNDI attribute values. The returned list must contain one element for each attribute mapped to the bean property, in the same order they appear in the XML mapping. If an attribute is multivalued, the corresponding element in the list should itself be a Collection.

Specified by:
getAttributeValues in interface JNDIBeanPropertyHandler
Parameters:
value - The bean property value to be converted.
Returns:
A list where each element is the value of a corresponding JNDI attribute. Collection values will be converted to multivalued attributes.
Throws:
JNDIBeanStoreException - If the bean property value could not be processed.


Created 2011-07-14 13:27 EST