public class MethodProperty extends GenericProperty
A MethodProperty
is a Property
which is accessed through accessor
methods (setX, getX). It is possible to have a MethodProperty
which has only setter,
only getter, or both. It is not possible to have a MethodProperty
which has neither
setter nor getter.
Modifier and Type | Field and Description |
---|---|
private java.beans.PropertyDescriptor |
property |
private boolean |
readable |
private boolean |
writable |
Constructor and Description |
---|
MethodProperty(java.beans.PropertyDescriptor property) |
Modifier and Type | Method and Description |
---|---|
private static java.lang.reflect.Type |
discoverGenericType(java.beans.PropertyDescriptor property) |
java.lang.Object |
get(java.lang.Object object) |
<A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<A> annotationType)
Returns property's annotation for the given type or
null if it's not present. |
java.util.List<java.lang.annotation.Annotation> |
getAnnotations()
Returns the annotations that are present on read and write methods of this property or empty
List if there're no annotations. |
boolean |
isReadable() |
boolean |
isWritable() |
void |
set(java.lang.Object object,
java.lang.Object value) |
getActualTypeArguments
private final java.beans.PropertyDescriptor property
private final boolean readable
private final boolean writable
private static java.lang.reflect.Type discoverGenericType(java.beans.PropertyDescriptor property)
public void set(java.lang.Object object, java.lang.Object value) throws java.lang.Exception
public java.util.List<java.lang.annotation.Annotation> getAnnotations()
List
if there're no annotations.getAnnotations
in class Property
List
if there're no
annotationspublic <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotationType)
null
if it's not present. If the
annotation is present on both read and write methods, the annotation on read method takes
precedence.getAnnotation
in class Property
A
- class of the annotationannotationType
- the type of the annotation to be returnednull
if it's not presentpublic boolean isWritable()
isWritable
in class Property
public boolean isReadable()
isReadable
in class Property