org.apache.tapestry5.ioc.internal.services
Class PropertyAdapterImpl

java.lang.Object
  extended by org.apache.tapestry5.ioc.internal.services.PropertyAdapterImpl
All Implemented Interfaces:
AnnotationProvider, PropertyAdapter

public class PropertyAdapterImpl
extends Object
implements PropertyAdapter


Method Summary
 Object get(Object instance)
          Reads the property value.
<T extends Annotation>
T
getAnnotation(Class<T> annotationClass)
          Searches for the specified annotation, returning the matching annotation instance.
 Class getBeanType()
          Returns the type of bean to which this property belongs.
 ClassPropertyAdapter getClassAdapter()
          Returns the ClassPropertyAdapter that provides access to other properties defined by the same class.
 String getName()
          Returns the name of the property.
 Method getReadMethod()
          Returns the method used to read the property, or null if the property is not readable.
 Class getType()
          Returns the type of the property.
 Method getWriteMethod()
          Returns the method used to update the property, or null if the property is not writeable.
 boolean isCastRequired()
          Returns true if the return type of the read method is not the same as the property type.
 boolean isRead()
          Returns true if the property is readable (i.e., has a getter method).
 boolean isUpdate()
          Returns true if the property is writeable (i.e., has a setter method).
 void set(Object instance, Object value)
          Updates the property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getName

public String getName()
Description copied from interface: PropertyAdapter
Returns the name of the property.

Specified by:
getName in interface PropertyAdapter

getReadMethod

public Method getReadMethod()
Description copied from interface: PropertyAdapter
Returns the method used to read the property, or null if the property is not readable.

Specified by:
getReadMethod in interface PropertyAdapter

getType

public Class getType()
Description copied from interface: PropertyAdapter
Returns the type of the property.

Specified by:
getType in interface PropertyAdapter

getWriteMethod

public Method getWriteMethod()
Description copied from interface: PropertyAdapter
Returns the method used to update the property, or null if the property is not writeable.

Specified by:
getWriteMethod in interface PropertyAdapter

isRead

public boolean isRead()
Description copied from interface: PropertyAdapter
Returns true if the property is readable (i.e., has a getter method).

Specified by:
isRead in interface PropertyAdapter

isUpdate

public boolean isUpdate()
Description copied from interface: PropertyAdapter
Returns true if the property is writeable (i.e., has a setter method).

Specified by:
isUpdate in interface PropertyAdapter

get

public Object get(Object instance)
Description copied from interface: PropertyAdapter
Reads the property value.

Specified by:
get in interface PropertyAdapter
Parameters:
instance - to read from

set

public void set(Object instance,
                Object value)
Description copied from interface: PropertyAdapter
Updates the property value. The provided value must not be null if the property type is primitive, and must otherwise be of the proper type.

Specified by:
set in interface PropertyAdapter
Parameters:
instance - to update
value - new value for the property

getAnnotation

public <T extends Annotation> T getAnnotation(Class<T> annotationClass)
Description copied from interface: AnnotationProvider
Searches for the specified annotation, returning the matching annotation instance.

Specified by:
getAnnotation in interface AnnotationProvider
Parameters:
annotationClass - used to select the annotation to return«
Returns:
the annotation, or null if not found

isCastRequired

public boolean isCastRequired()
Description copied from interface: PropertyAdapter
Returns true if the return type of the read method is not the same as the property type. This can occur when the property has been defined using generics, in which case, the method's type may be Object when the property type is something more specific. This method is primarily used when generating runtime code related to the property.

Specified by:
isCastRequired in interface PropertyAdapter

getClassAdapter

public ClassPropertyAdapter getClassAdapter()
Description copied from interface: PropertyAdapter
Returns the ClassPropertyAdapter that provides access to other properties defined by the same class.

Specified by:
getClassAdapter in interface PropertyAdapter

getBeanType

public Class getBeanType()
Description copied from interface: PropertyAdapter
Returns the type of bean to which this property belongs. This is the same as ClassPropertyAdapter.getBeanType().

Specified by:
getBeanType in interface PropertyAdapter


Copyright © 2006-2009 Apache Software Foundation. All Rights Reserved.