net.sourceforge.stripes.util.bean
Class JavaBeanPropertyAccessor
java.lang.Object
net.sourceforge.stripes.util.bean.JavaBeanPropertyAccessor
- All Implemented Interfaces:
- PropertyAccessor<Object>
public class JavaBeanPropertyAccessor
- extends Object
- implements PropertyAccessor<Object>
Implementation of PropertyAccessor
for reading JavaBean properties from
JavaBeans. Will attempt property access first using the standard PropertyDescriptor,
but if no PropertyDescriptor is present then falls back to attempting Field access for
public fields.
- Since:
- Stripes 1.4
- Author:
- Tim Fennell
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JavaBeanPropertyAccessor
public JavaBeanPropertyAccessor()
getValue
public Object getValue(NodeEvaluation evaluation,
Object bean)
throws NoSuchPropertyException,
EvaluationException
- Fetches the specified property value from the bean if it exists.
- Specified by:
getValue
in interface PropertyAccessor<Object>
- Parameters:
evaluation
- the current node evaluationbean
- the bean from which to fetch the property
- Returns:
- the value of the property
- Throws:
NoSuchPropertyException
- if there is no property with the supplied name
EvaluationException
- if the value cannot be retrieved for any other reason
setValue
public void setValue(NodeEvaluation evaluation,
Object bean,
Object value)
- Sets the specified property value to the supplied value.
- Specified by:
setValue
in interface PropertyAccessor<Object>
- Parameters:
evaluation
- the current node evaluationbean
- the bean on to which to set the propertyvalue
- the value of the property
- Throws:
NoSuchPropertyException
- if there is no property with the supplied name
EvaluationException
- if the value cannot be set for any other reason
? Copyright 2005-2006, Stripes Development Team.