org.directwebremoting.convert
Class PlainProperty

java.lang.Object
  extended by org.directwebremoting.convert.PlainProperty
All Implemented Interfaces:
Property

public class PlainProperty
extends java.lang.Object
implements Property

An implementation of Property that simply uses stored values.

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

Constructor Summary
PlainProperty(java.lang.String name, java.lang.Object value)
           
 
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

PlainProperty

public PlainProperty(java.lang.String name,
                     java.lang.Object value)
Parameters:
name - The property name
value - The property value irrespective of the object that we read it on
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)

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

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