org.directwebremoting.extend
Class FieldProperty

java.lang.Object
  extended by org.directwebremoting.extend.FieldProperty
All Implemented Interfaces:
Property

public class FieldProperty
extends java.lang.Object
implements Property

An implementation of Property that proxies to a Field

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Constructor Summary
FieldProperty(java.lang.reflect.Field field)
           
 
Method Summary
 Property createChild(int newParameterNumber)
          Properties may have children where we have nested generic type info.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getName()
          Gets the name of this property
 java.lang.Class<?> getPropertyType()
          What type does this property
 java.lang.Object getValue(java.lang.Object bean)
          Get the value of this property of the passed in java bean
 int hashCode()
           
 void setValue(java.lang.Object bean, java.lang.Object value)
          Set the value of this property of the passed in java bean
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldProperty

public FieldProperty(java.lang.reflect.Field field)
Parameters:
field - The Field that we are proxying to
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Property
Gets the name of this property

Specified by:
getName in interface Property
Returns:
The property name

getPropertyType

public java.lang.Class<?> getPropertyType()
Description copied from interface: Property
What type does this property

Specified by:
getPropertyType in interface Property
Returns:
The type of object that will be returned by Property.getValue(Object)

createChild

public Property createChild(int newParameterNumber)
Description copied from interface: Property
Properties may have children where we have nested generic type info. For example with setFoo(List<Map<String, Class<?>> x) we can find type information about the nested bits of generic data.

If calling this method then you almost certainly want to check for an overridden property as defined by the ConverterManager by calling ConverterManager.checkOverride(Property)

Specified by:
createChild in interface Property
Parameters:
newParameterNumber - Generally the parameter offset.
Returns:
A Property to describe the nested bit of data

getValue

public java.lang.Object getValue(java.lang.Object bean)
                          throws ConversionException
Description copied from interface: Property
Get the value of this property of the passed in java bean

Specified by:
getValue in interface Property
Parameters:
bean - The bean to introspect
Returns:
The value assigned to this property of the passed in bean
Throws:
ConversionException - If the reflection access fails

setValue

public void setValue(java.lang.Object bean,
                     java.lang.Object value)
              throws ConversionException
Description copied from interface: Property
Set the value of this property of the passed in java bean

Specified by:
setValue in interface Property
Parameters:
bean - The bean to introspect
value - The value assigned to this property of the passed in bean
Throws:
ConversionException - If the reflection access fails

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Copyright 2008