net.sf.navel.beans
Interface IndexedPropertyDelegate<C,T>

All Superinterfaces:
PropertyDelegate<T>, java.io.Serializable

public interface IndexedPropertyDelegate<C,T>
extends PropertyDelegate<T>

This delegate is to PropertyDelegate as IndexedPropertyDescriptor in the JavaBeans API is to PropertyDescriptor.

Author:
cmdln

Method Summary
 java.lang.Class<C> componentType()
          Used to ensure that the parameterization of the component type of the indexed property won't cause problems for the PropertyHandler.
 C get(PropertyValues values, java.lang.String propertyName, int index)
          Invoked by the PropertyHandler when a read is performed against a specified indexed property, alternate that returns the element at the specified index, rather than the entire array.
 void set(PropertyValues values, java.lang.String propertyName, int index, C value)
          Invoked by the PropertyHandler when a write is performed against a specified indexed property, alternate that sets the element at the specified index, rather than the entire array.
 
Methods inherited from interface net.sf.navel.beans.PropertyDelegate
get, propertyType, set
 

Method Detail

componentType

java.lang.Class<C> componentType()
Used to ensure that the parameterization of the component type of the indexed property won't cause problems for the PropertyHandler.

Returns:
Should match the component type of the T parameters, which will be checked to ensure it is an array.

get

C get(PropertyValues values,
      java.lang.String propertyName,
      int index)
Invoked by the PropertyHandler when a read is performed against a specified indexed property, alternate that returns the element at the specified index, rather than the entire array.

Parameters:
values - Gives the delegate access to the internal state of the bean.
propertyName - Discriminates which property is being accessed, so a single delegate can intelligently be re-used.
index - Element to manipulate.
Returns:
Must match the property type or will cause an InvocationTargetException.

set

void set(PropertyValues values,
         java.lang.String propertyName,
         int index,
         C value)
Invoked by the PropertyHandler when a write is performed against a specified indexed property, alternate that sets the element at the specified index, rather than the entire array.

Parameters:
values - Gives the delegate access to the internal state of the bean.
propertyName - Discriminates which property is being accessed, so a single delegate can intelligently be re-used.
index - Element to manipulate.