org.apache.commons.betwixt.expression
Class DynaBeanExpression

java.lang.Object
  extended by org.apache.commons.betwixt.expression.DynaBeanExpression
All Implemented Interfaces:
Expression

public class DynaBeanExpression
extends java.lang.Object
implements Expression

An Expression that gets a property value from a DynaBean.

Since:
0.5
Author:
Michael Becke
See Also:
DynaBean

Constructor Summary
DynaBeanExpression()
          Crates a new DynaBeanExpression.
DynaBeanExpression(java.lang.String propertyName)
          Crates a new DynaBeanExpression.
 
Method Summary
 java.lang.Object evaluate(Context context)
          Returns the value of a DynaBean property from the bean stored in the Context.
 java.lang.String getPropertyName()
          Gets the name of the property to get from the DynaBean.
 void setPropertyName(java.lang.String propertyName)
          Sets the name of the property to get from the DynaBean.
 void update(Context context, java.lang.String newValue)
          Do nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynaBeanExpression

public DynaBeanExpression()
Crates a new DynaBeanExpression.


DynaBeanExpression

public DynaBeanExpression(java.lang.String propertyName)
Crates a new DynaBeanExpression.

Parameters:
propertyName - the name of the DynaBean property to use
Method Detail

evaluate

public java.lang.Object evaluate(Context context)
Returns the value of a DynaBean property from the bean stored in the Context. Returns null if no DynaBean is stored in the Context or if the propertyName has not been set.

Specified by:
evaluate in interface Expression
Parameters:
context - the content containing the DynaBean
Returns:
the DynaBean property value or null

update

public void update(Context context,
                   java.lang.String newValue)
Do nothing.

Specified by:
update in interface Expression
Parameters:
context - update this Context
newValue - the new value for this expression
See Also:
Expression.update(org.apache.commons.betwixt.expression.Context, java.lang.String)

getPropertyName

public java.lang.String getPropertyName()
Gets the name of the property to get from the DynaBean.

Returns:
the name of the property that this expression reads

setPropertyName

public void setPropertyName(java.lang.String propertyName)
Sets the name of the property to get from the DynaBean.

Parameters:
propertyName - the property that this expression reads, not null


Copyright © 2002-2008 The Apache Software Foundation. All Rights Reserved.