public interface PropertyAccess
Modifier and Type | Method and Description |
---|---|
void |
clearCache()
Discards all stored property access information, discarding all created class adapters.
|
Object |
get(Object instance,
String propertyName)
Reads the value of a property.
|
ClassPropertyAdapter |
getAdapter(Class forClass)
Returns the adapter used to access properties within the indicated class.
|
ClassPropertyAdapter |
getAdapter(Object instance)
Returns the adapter for a particular object instance.
|
Annotation |
getAnnotation(Object instance,
String propertyName,
Class<? extends Annotation> annotationClass)
Returns the annotation of a given property for the specified type if such an annotation is present, else null.
|
void |
set(Object instance,
String propertyName,
Object value)
Updates the value of a property.
|
Object get(Object instance, String propertyName)
UnsupportedOperationException
- if the property is write onlyIllegalArgumentException
- if property does not existvoid set(Object instance, String propertyName, Object value)
UnsupportedOperationException
- if the property is read onlyIllegalArgumentException
- if property does not existAnnotation getAnnotation(Object instance, String propertyName, Class<? extends Annotation> annotationClass)
getAdapter(Object)
.ClassPropertyAdapter.getPropertyAdapter(String)
.AnnotationProvider.getAnnotation(Class)
instance
- the object to read a value frompropertyName
- the name of the property to read (case is ignored)annotationClass
- the type of annotation to returnIllegalArgumentException
- if property does not existClassPropertyAdapter getAdapter(Object instance)
getAdapter(Class)
.ClassPropertyAdapter getAdapter(Class forClass)
void clearCache()
5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.