public static class JavaBeanPropertyStyle.FieldProperty extends BaseProperty
We found JavaBeanPropertyStyle
to be generally useful outside of any
Inspector
. When using it that way, it is also generally useful to have access to
FieldProperty
. So this class is public.
Constructor and Description |
---|
JavaBeanPropertyStyle.FieldProperty(String name,
Field field) |
Modifier and Type | Method and Description |
---|---|
<T extends Annotation> |
getAnnotation(Class<T> annotation)
Returns this element's annotation for the specified type if such an annotation is present,
else null.
|
Field |
getField() |
String |
getGenericType()
Gets the generic type of the property, or null if the type is not parameterized.
|
boolean |
isReadable() |
boolean |
isWritable() |
Object |
read(Object obj)
Read the property for the given object.
|
void |
write(Object obj,
Object value)
Write the property for the given object.
|
getType
getName, isAnnotationPresent, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName, isAnnotationPresent
public boolean isReadable()
public Object read(Object obj)
Property
Used by PropertyInspector to determine subtypes, and by BaseObjectInspector to traverse the object graph.
public boolean isWritable()
public void write(Object obj, Object value)
Property
Used by BeanUtilsBindingProcessor, and is also nicely symmetrical with read
.
public <T extends Annotation> T getAnnotation(Class<T> annotation)
Trait
Note: for subclasses, whether anything is returned for annotations defined by the superclass
is decided by the java.lang.annotation.Inherited
annotation.
public String getGenericType()
Property
Type is returned as a String, so that it can express something other than a
java.lang.Class
(eg. javassist.CtClass
or
org.jboss.forge.parser.java.JavaClass
).
public Field getField()
Copyright © 2015. All Rights Reserved.