public interface ClassPropertyAdapter
PropertyAdapter
s for a particular class.
Only provides access to simple properties. Indexed properties are ignored.
When accessing properties by name, the case of the name is ignored.Modifier and Type | Method and Description |
---|---|
Object |
get(Object instance,
String propertyName)
Reads the value of a property.
|
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.
|
Class |
getBeanType()
Returns the type of bean this adapter provides properties for.
|
PropertyAdapter |
getPropertyAdapter(String name)
Returns the property adapter with the given name, or null if no such adapter exists.
|
List<String> |
getPropertyNames()
Returns the names of all properties, sorted into alphabetic order.
|
void |
set(Object instance,
String propertyName,
Object value)
Updates the value of a property.
|
List<String> getPropertyNames()
Class getBeanType()
PropertyAdapter getPropertyAdapter(String name)
name
- of the property (case is ignored)Object get(Object instance, String propertyName)
instance
- the object to read a value frompropertyName
- the name of the property to read (case is ignored)UnsupportedOperationException
- if the property is write onlyIllegalArgumentException
- if property does not existvoid set(Object instance, String propertyName, Object value)
instance
- the object to updatepropertyName
- the name of the property to update (case is ignored)UnsupportedOperationException
- if the property is read onlyIllegalArgumentException
- if property does not existAnnotation getAnnotation(Object instance, String propertyName, Class<? extends Annotation> annotationClass)
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 exist${project.version} - Copyright © 2003-2015 The Apache Software Foundation.