net.sourceforge.stripes.util.bean
Class ArrayPropertyAccessor

java.lang.Object
  extended by net.sourceforge.stripes.util.bean.ArrayPropertyAccessor
All Implemented Interfaces:
PropertyAccessor<Object>

public class ArrayPropertyAccessor
extends Object
implements PropertyAccessor<Object>

Implementation of the PropertyAccessor interface for interacting with arrays. Throws exceptions if the index is not an integer or if the index is out of range for the current array.

Since:
Stripes 1.4
Author:
Tim Fennell

Constructor Summary
ArrayPropertyAccessor()
           
 
Method Summary
 Object getValue(NodeEvaluation evaluation, Object target)
          Gets the index specified by the current node from the target array.
 void setValue(NodeEvaluation evaluation, Object target, Object value)
          Sets the value at the index specified by the current node to the supplied value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayPropertyAccessor

public ArrayPropertyAccessor()
Method Detail

getValue

public Object getValue(NodeEvaluation evaluation,
                       Object target)
Gets the index specified by the current node from the target array.

Specified by:
getValue in interface PropertyAccessor<Object>
Parameters:
evaluation - the current NodeEvaluation containing the array index
target - the target array
Returns:
the element stored at that index

setValue

public void setValue(NodeEvaluation evaluation,
                     Object target,
                     Object value)
Sets the value at the index specified by the current node to the supplied value.

Specified by:
setValue in interface PropertyAccessor<Object>
Parameters:
evaluation - the current NodeEvaluation containing the array index
target - the target array
value - the value to set, possibly null


? Copyright 2005-2006, Stripes Development Team.