public final class ObjectElement extends AbstractElement
The property can be defined by fields, getters or setters methods. If more than one are present, only one will be used to return annotations. Here is the list in priority order:
For value manipulations (write and read), the methods are used all the time.
annotatedElement, name
Constructor and Description |
---|
ObjectElement(java.lang.reflect.Field field) |
ObjectElement(java.lang.reflect.Method method,
java.lang.String name)
Creates a new ObjectElement based on the specified method.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Class<?> |
declaringClass() |
ValueHandler |
in(java.lang.Object target)
Handles this element on the given target (if applies).
|
boolean |
isReadable() |
boolean |
isWritable() |
java.lang.Class<?> |
type() |
getAnnotation, getAnnotations, getDeclaredAnnotations, isAnnotationPresent, isSpecific, name, set, target, toString, value
public ObjectElement(java.lang.reflect.Field field)
public ObjectElement(java.lang.reflect.Method method, java.lang.String name)
public ValueHandler in(java.lang.Object target)
Element
This method may throw exceptions in case of the element cannot be handled or an error occurring while handling the element.
target
- the target that contains this element.public boolean isReadable()
true
if the value of this element can be read.public boolean isWritable()
true
if the value of this element can be change.public java.lang.Class<?> declaringClass()
public java.lang.Class<?> type()
type
in interface Element
type
in class AbstractElement