net.sf.navel.beans
Interface PropertyDelegate<T>

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
IndexedPropertyDelegate<C,T>

public interface PropertyDelegate<T>
extends java.io.Serializable

Interface for providing handling on a property by property basis. Allows overriding of the default behavior and provides access to the PropertyValues component within the proxy to read and manipulate the bean's internal state. Since the get and set calls provide direct access to the internal storage of the delegating bean, implementers of this interface should be stateless. This is also required to work safely with the copy methods on ProxyFactory.

Author:
cmdln

Method Summary
 T get(PropertyValues values, java.lang.String propertyName)
          Invoked by the PropertyHandler when a read is performed against a specified property.
 java.lang.Class<T> propertyType()
          For constraint checking so that the parameterized type can be ensured to work with the property to which this may be attached.
 void set(PropertyValues values, java.lang.String propertyName, T value)
          Invoked by the PropertyHandler when a write is performed against a specified property.
 

Method Detail

propertyType

java.lang.Class<T> propertyType()
For constraint checking so that the parameterized type can be ensured to work with the property to which this may be attached.


get

T get(PropertyValues values,
      java.lang.String propertyName)
Invoked by the PropertyHandler when a read is performed against a specified property.

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.
Returns:
Must match the property type or will cause an InvocationTargetException.

set

void set(PropertyValues values,
         java.lang.String propertyName,
         T value)
Invoked by the PropertyHandler when a write is performed against a specified property.

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.