public class JavaBeanPropertyAccessor extends java.lang.Object implements PropertyAccessor<java.lang.Object>
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.Constructor and Description |
---|
JavaBeanPropertyAccessor() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getValue(NodeEvaluation evaluation,
java.lang.Object bean)
Fetches the specified property value from the bean if it exists.
|
void |
setValue(NodeEvaluation evaluation,
java.lang.Object bean,
java.lang.Object value)
Sets the specified property value to the supplied value.
|
public java.lang.Object getValue(NodeEvaluation evaluation, java.lang.Object bean) throws NoSuchPropertyException, EvaluationException
getValue
in interface PropertyAccessor<java.lang.Object>
evaluation
- the current node evaluationbean
- the bean from which to fetch the propertyNoSuchPropertyException
- if there is no property with the supplied nameEvaluationException
- if the value cannot be retrieved for any other reasonpublic void setValue(NodeEvaluation evaluation, java.lang.Object bean, java.lang.Object value)
setValue
in interface PropertyAccessor<java.lang.Object>
evaluation
- the current node evaluationbean
- the bean on to which to set the propertyvalue
- the value of the propertyNoSuchPropertyException
- if there is no property with the supplied nameEvaluationException
- if the value cannot be set for any other reason? Copyright 2005-2006, Stripes Development Team.