org.directwebremoting.impl
Class FieldProperty

java.lang.Object
  extended by org.directwebremoting.impl.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
 java.lang.String getName()
          Gets the name of this property
 java.lang.Class getPropertyType()
          What type does this property
 java.lang.reflect.Method getSetter()
          This is a nasty hack - TypeHintContext needs a Method.
 java.lang.Object getValue(java.lang.Object bean)
          Get the value of this property of the passed in java bean
 void setValue(java.lang.Object bean, java.lang.Object value)
          Set the value of this property of the passed in java bean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, 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)

getValue

public java.lang.Object getValue(java.lang.Object bean)
                          throws MarshallException
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:
MarshallException - If the reflection access fails

setValue

public void setValue(java.lang.Object bean,
                     java.lang.Object value)
              throws MarshallException
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:
MarshallException - If the reflection access fails

getSetter

public java.lang.reflect.Method getSetter()
Description copied from interface: Property
This is a nasty hack - TypeHintContext needs a Method. If you are implementing this and not proxying to a PropertyDescriptor then you can probably return null. We should probably refactor TypeHintContext to use Property

Specified by:
getSetter in interface Property
Returns:
A setter method if one is available, or null otherwise