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.
Constructor and Description |
---|
MethodProperty(PropertyDescriptor property) |
Modifier and Type | Method and Description |
---|---|
Object |
get(Object object) |
<A extends Annotation> |
getAnnotation(Class<A> annotationType)
Returns property's annotation for the given type or
null if it's not present. |
List<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(Object object,
Object value) |
getActualTypeArguments
public MethodProperty(PropertyDescriptor property)
public List<Annotation> getAnnotations()
List
if
there're no annotations.getAnnotations
in class Property
List
if there're no annotationspublic <A extends Annotation> A getAnnotation(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
Copyright © 2008–2020. All rights reserved.