public class FieldPropertyAccessor extends Object implements PropertyAccessor
Constructor and Description |
---|
FieldPropertyAccessor(Field field) |
Modifier and Type | Method and Description |
---|---|
<A extends Annotation> |
findAnnotation(Class<A> annotationClass)
Retrieve the annotation on a property.
|
String |
getName()
Retrieve the property name.
|
Method |
getReadMethod() |
Class<?> |
getType()
Retrieve the property type.
|
Object |
getValue(Object instance)
Retrieve the property value.
|
Method |
getWriteMethod() |
boolean |
isReadable()
Determine if the property is readable.
|
boolean |
isWritable()
Determine if the property is writable.
|
void |
setValue(Object instance,
Object value)
Modify the property value.
|
public FieldPropertyAccessor(Field field)
public String getName()
getName
in interface PropertyAccessor
public Class<?> getType()
getType
in interface PropertyAccessor
public <A extends Annotation> A findAnnotation(Class<A> annotationClass)
findAnnotation
in interface PropertyAccessor
A
- class type of the annotation classannotationClass
- annotation classpublic boolean isReadable()
isReadable
in interface PropertyAccessor
true
when readable, else false
public Object getValue(Object instance)
getValue
in interface PropertyAccessor
instance
- bean that contains the propertypublic boolean isWritable()
isWritable
in interface PropertyAccessor
true
when writable, else false
public void setValue(Object instance, Object value)
setValue
in interface PropertyAccessor
instance
- bean that contains the propertyvalue
- the new property valuepublic Method getReadMethod()
getReadMethod
in interface PropertyAccessor
public Method getWriteMethod()
getWriteMethod
in interface PropertyAccessor
Copyright © 2015–2017 42 BV. All rights reserved.