public class ClassPropertyAdapterImpl extends Object implements ClassPropertyAdapter
Constructor and Description |
---|
ClassPropertyAdapterImpl(Class beanType,
List<PropertyDescriptor> descriptors) |
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.
|
String |
toString() |
public ClassPropertyAdapterImpl(Class beanType, List<PropertyDescriptor> descriptors)
public Class getBeanType()
ClassPropertyAdapter
getBeanType
in interface ClassPropertyAdapter
public List<String> getPropertyNames()
ClassPropertyAdapter
getPropertyNames
in interface ClassPropertyAdapter
public PropertyAdapter getPropertyAdapter(String name)
ClassPropertyAdapter
getPropertyAdapter
in interface ClassPropertyAdapter
name
- of the property (case is ignored)public Object get(Object instance, String propertyName)
ClassPropertyAdapter
get
in interface ClassPropertyAdapter
instance
- the object to read a value frompropertyName
- the name of the property to read (case is ignored)public void set(Object instance, String propertyName, Object value)
ClassPropertyAdapter
set
in interface ClassPropertyAdapter
instance
- the object to updatepropertyName
- the name of the property to update (case is ignored)value
- the value to be setpublic Annotation getAnnotation(Object instance, String propertyName, Class<? extends Annotation> annotationClass)
ClassPropertyAdapter
getAnnotation
in interface ClassPropertyAdapter
instance
- the object to read a value frompropertyName
- the name of the property to read (case is ignored)annotationClass
- the type of annotation to return5.6.3 - Copyright © 2003-2021 The Apache Software Foundation.