public class PropertyAdapterImpl extends Object implements PropertyAdapter
Modifier and Type | Method and Description |
---|---|
Object |
get(Object instance)
Reads the property value.
|
<T extends Annotation> |
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. |
Class |
getDeclaringClass()
The class in which the property (or public field) is defined.
|
Field |
getField()
Returns the field if the property is a public field or null if the property is accessed via the read method.
|
String |
getName()
Returns the name of the property (or public field).
|
Method |
getReadMethod()
Returns the method used to read the property, or null if the property is not readable (or is a public field).
|
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 (or a public field).
|
boolean |
isCastRequired()
Returns true if the return type of the read method is not the same as the property type.
|
boolean |
isField()
Returns true if the property is actually a public field (possibly, a public static field).
|
boolean |
isRead()
Returns true if the property is readable (i.e., has a getter method or is a public field).
|
boolean |
isUpdate()
Returns true if the property is writeable (i.e., has a setter method or is a non-final field).
|
void |
set(Object instance,
Object value)
Updates the property value.
|
public String getName()
PropertyAdapter
getName
in interface PropertyAdapter
public Method getReadMethod()
PropertyAdapter
getReadMethod
in interface PropertyAdapter
public Class getType()
PropertyAdapter
getType
in interface PropertyAdapter
public Method getWriteMethod()
PropertyAdapter
getWriteMethod
in interface PropertyAdapter
public boolean isRead()
PropertyAdapter
isRead
in interface PropertyAdapter
public boolean isUpdate()
PropertyAdapter
isUpdate
in interface PropertyAdapter
public Object get(Object instance)
PropertyAdapter
get
in interface PropertyAdapter
instance
- to read frompublic void set(Object instance, Object value)
PropertyAdapter
set
in interface PropertyAdapter
instance
- to updatevalue
- new value for the propertypublic <T extends Annotation> T getAnnotation(Class<T> annotationClass)
AnnotationProvider
getAnnotation
in interface AnnotationProvider
annotationClass
- used to select the annotation to returnpublic boolean isCastRequired()
PropertyAdapter
isCastRequired
in interface PropertyAdapter
public ClassPropertyAdapter getClassAdapter()
PropertyAdapter
ClassPropertyAdapter
that provides access to other
properties defined by the same class.getClassAdapter
in interface PropertyAdapter
public Class getBeanType()
PropertyAdapter
ClassPropertyAdapter.getBeanType()
.getBeanType
in interface PropertyAdapter
public boolean isField()
PropertyAdapter
isField
in interface PropertyAdapter
public Field getField()
PropertyAdapter
getField
in interface PropertyAdapter
public Class getDeclaringClass()
PropertyAdapter
getDeclaringClass
in interface PropertyAdapter
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.