org.directwebremoting.impl
Class PropertyDescriptorProperty

java.lang.Object
  extended by org.directwebremoting.impl.PropertyDescriptorProperty
All Implemented Interfaces:
Property
Direct Known Subclasses:
H2PropertyDescriptorProperty, H3PropertyDescriptorProperty

public class PropertyDescriptorProperty
extends java.lang.Object
implements Property

An implementation of Property that proxies to a PropertyDescriptor

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

Constructor Summary
PropertyDescriptorProperty(java.beans.PropertyDescriptor descriptor)
           
 
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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyDescriptorProperty

public PropertyDescriptorProperty(java.beans.PropertyDescriptor descriptor)
Parameters:
descriptor - The PropertyDescriptor 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

Copyright ? 2005