org.directwebremoting.extend
Class NestedProperty

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

public class NestedProperty
extends java.lang.Object
implements Property

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

Constructor Summary
NestedProperty(Property parent, java.lang.Object method, java.lang.reflect.Type parentParameterType, int parameterNumber, int newParameterNumber)
           
 
Method Summary
 Property createChild(int aNewParameterNumber)
          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.reflect.Type getParameterType()
           
 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

NestedProperty

public NestedProperty(Property parent,
                      java.lang.Object method,
                      java.lang.reflect.Type parentParameterType,
                      int parameterNumber,
                      int newParameterNumber)
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 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

createChild

public Property createChild(int aNewParameterNumber)
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:
aNewParameterNumber - Generally the parameter offset.
Returns:
A Property to describe the nested bit of data

getParameterType

public java.lang.reflect.Type getParameterType()
Returns:
The type parameter

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