uk.co.lakesidetech.spxforms.beans
Class JXPathBeanWrapper

java.lang.Object
  extended byuk.co.lakesidetech.spxforms.beans.JXPathBeanWrapper
All Implemented Interfaces:
org.springframework.beans.BeanWrapper, org.springframework.beans.PropertyAccessor

public class JXPathBeanWrapper
extends java.lang.Object
implements org.springframework.beans.BeanWrapper

TODO deal with xpath errors better and throw PropertyAccessExceptionsException

Author:
Stuart Eccles

Field Summary
 
Fields inherited from interface org.springframework.beans.PropertyAccessor
NESTED_PROPERTY_SEPARATOR, NESTED_PROPERTY_SEPARATOR_CHAR, PROPERTY_KEY_PREFIX, PROPERTY_KEY_PREFIX_CHAR, PROPERTY_KEY_SUFFIX, PROPERTY_KEY_SUFFIX_CHAR
 
Constructor Summary
JXPathBeanWrapper(org.apache.commons.jxpath.JXPathContext jxpathcontext)
           
 
Method Summary
 java.beans.PropertyEditor findCustomEditor(java.lang.Class requiredType, java.lang.String propertyPath)
           
 org.apache.commons.jxpath.JXPathContext getJxpathcontext()
           
 java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String propertyName)
           
 java.beans.PropertyDescriptor[] getPropertyDescriptors()
           
 java.lang.Double getPropertyNodeSetCount(java.lang.String propertyName)
           
 java.lang.Class getPropertyType(java.lang.String propertyName)
           
 java.lang.Object getPropertyValue(java.lang.String propertyName)
           
 java.lang.Class getWrappedClass()
           
 java.lang.Object getWrappedInstance()
           
protected  boolean isAllowedXBinding(java.lang.String propertyName)
           
 boolean isReadableProperty(java.lang.String propertyName)
           
 boolean isWritableProperty(java.lang.String propertyName)
           
 void registerCustomEditor(java.lang.Class requiredType, java.beans.PropertyEditor propertyEditor)
           
 void registerCustomEditor(java.lang.Class requiredType, java.lang.String propertyPath, java.beans.PropertyEditor propertyEditor)
           
 void setPropertyValue(org.springframework.beans.PropertyValue pv)
           
 void setPropertyValue(java.lang.String propertyName, java.lang.Object value)
           
 void setPropertyValues(java.util.Map map)
           
 void setPropertyValues(org.springframework.beans.PropertyValues propertyValues)
           
 void setPropertyValues(org.springframework.beans.PropertyValues propertyValues, boolean ignoreUnknown)
           
 void setWrappedInstance(java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JXPathBeanWrapper

public JXPathBeanWrapper(org.apache.commons.jxpath.JXPathContext jxpathcontext)
Method Detail

getJxpathcontext

public org.apache.commons.jxpath.JXPathContext getJxpathcontext()
Returns:
Returns the jxpathcontext.

setWrappedInstance

public void setWrappedInstance(java.lang.Object obj)
Specified by:
setWrappedInstance in interface org.springframework.beans.BeanWrapper
Parameters:
obj -
See Also:
BeanWrapper.setWrappedInstance(java.lang.Object)

getWrappedInstance

public java.lang.Object getWrappedInstance()
Specified by:
getWrappedInstance in interface org.springframework.beans.BeanWrapper
Returns:
See Also:
BeanWrapper.getWrappedInstance()

getWrappedClass

public java.lang.Class getWrappedClass()
Specified by:
getWrappedClass in interface org.springframework.beans.BeanWrapper
Returns:
See Also:
BeanWrapper.getWrappedClass()

registerCustomEditor

public void registerCustomEditor(java.lang.Class requiredType,
                                 java.beans.PropertyEditor propertyEditor)
Specified by:
registerCustomEditor in interface org.springframework.beans.BeanWrapper
Parameters:
requiredType -
propertyEditor -
See Also:
BeanWrapper.registerCustomEditor(java.lang.Class, java.beans.PropertyEditor)

registerCustomEditor

public void registerCustomEditor(java.lang.Class requiredType,
                                 java.lang.String propertyPath,
                                 java.beans.PropertyEditor propertyEditor)
Specified by:
registerCustomEditor in interface org.springframework.beans.BeanWrapper
Parameters:
requiredType -
propertyPath -
propertyEditor -
See Also:
BeanWrapper.registerCustomEditor(java.lang.Class, java.lang.String, java.beans.PropertyEditor)

findCustomEditor

public java.beans.PropertyEditor findCustomEditor(java.lang.Class requiredType,
                                                  java.lang.String propertyPath)
Specified by:
findCustomEditor in interface org.springframework.beans.BeanWrapper
Parameters:
requiredType -
propertyPath -
Returns:
See Also:
BeanWrapper.findCustomEditor(java.lang.Class, java.lang.String)

getPropertyDescriptors

public java.beans.PropertyDescriptor[] getPropertyDescriptors()
                                                       throws org.springframework.beans.BeansException
Specified by:
getPropertyDescriptors in interface org.springframework.beans.BeanWrapper
Returns:
Throws:
org.springframework.beans.BeansException
See Also:
BeanWrapper.getPropertyDescriptors()

getPropertyDescriptor

public java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String propertyName)
                                                    throws org.springframework.beans.BeansException
Specified by:
getPropertyDescriptor in interface org.springframework.beans.BeanWrapper
Parameters:
propertyName -
Returns:
Throws:
org.springframework.beans.BeansException
See Also:
BeanWrapper.getPropertyDescriptor(java.lang.String)

getPropertyType

public java.lang.Class getPropertyType(java.lang.String propertyName)
                                throws org.springframework.beans.BeansException
Specified by:
getPropertyType in interface org.springframework.beans.BeanWrapper
Parameters:
propertyName -
Returns:
Throws:
org.springframework.beans.BeansException
See Also:
BeanWrapper.getPropertyType(java.lang.String)

isReadableProperty

public boolean isReadableProperty(java.lang.String propertyName)
                           throws org.springframework.beans.BeansException
Specified by:
isReadableProperty in interface org.springframework.beans.BeanWrapper
Parameters:
propertyName -
Returns:
Throws:
org.springframework.beans.BeansException
See Also:
BeanWrapper.isReadableProperty(java.lang.String)

isWritableProperty

public boolean isWritableProperty(java.lang.String propertyName)
                           throws org.springframework.beans.BeansException
Specified by:
isWritableProperty in interface org.springframework.beans.BeanWrapper
Parameters:
propertyName -
Returns:
Throws:
org.springframework.beans.BeansException
See Also:
BeanWrapper.isWritableProperty(java.lang.String)

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String propertyName)
                                  throws org.springframework.beans.BeansException
Specified by:
getPropertyValue in interface org.springframework.beans.PropertyAccessor
Parameters:
propertyName -
Returns:
Throws:
org.springframework.beans.BeansException
See Also:
PropertyAccessor.getPropertyValue(java.lang.String)

getPropertyNodeSetCount

public java.lang.Double getPropertyNodeSetCount(java.lang.String propertyName)
                                         throws org.springframework.beans.BeansException
Throws:
org.springframework.beans.BeansException

setPropertyValue

public void setPropertyValue(java.lang.String propertyName,
                             java.lang.Object value)
                      throws org.springframework.beans.BeansException
Specified by:
setPropertyValue in interface org.springframework.beans.PropertyAccessor
Parameters:
propertyName -
value -
Throws:
org.springframework.beans.BeansException
See Also:
PropertyAccessor.setPropertyValue(java.lang.String, java.lang.Object)

setPropertyValue

public void setPropertyValue(org.springframework.beans.PropertyValue pv)
                      throws org.springframework.beans.BeansException
Specified by:
setPropertyValue in interface org.springframework.beans.PropertyAccessor
Parameters:
pv -
Throws:
org.springframework.beans.BeansException
See Also:
PropertyAccessor.setPropertyValue(org.springframework.beans.PropertyValue)

setPropertyValues

public void setPropertyValues(java.util.Map map)
                       throws org.springframework.beans.BeansException
Specified by:
setPropertyValues in interface org.springframework.beans.PropertyAccessor
Parameters:
map -
Throws:
org.springframework.beans.BeansException
See Also:
PropertyAccessor.setPropertyValues(java.util.Map)

setPropertyValues

public void setPropertyValues(org.springframework.beans.PropertyValues propertyValues)
                       throws org.springframework.beans.BeansException
Specified by:
setPropertyValues in interface org.springframework.beans.PropertyAccessor
Throws:
org.springframework.beans.BeansException
See Also:
PropertyAccessor.setPropertyValues(org.springframework.beans.PropertyValues)

setPropertyValues

public void setPropertyValues(org.springframework.beans.PropertyValues propertyValues,
                              boolean ignoreUnknown)
                       throws org.springframework.beans.BeansException
Specified by:
setPropertyValues in interface org.springframework.beans.PropertyAccessor
Parameters:
ignoreUnknown -
Throws:
org.springframework.beans.BeansException
See Also:
PropertyAccessor.setPropertyValues(org.springframework.beans.PropertyValues, boolean)

isAllowedXBinding

protected boolean isAllowedXBinding(java.lang.String propertyName)