public class BeanHelper
extends java.lang.Object
| Constructor and Description |
|---|
BeanHelper(java.lang.Class<?> clazz)
Create a BeanHelper for the given class.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<java.beans.PropertyDescriptor> |
findAllProperties() |
<T extends java.lang.annotation.Annotation> |
findAnnotation(java.lang.String property,
java.lang.Class<T> annotationClass)
Searches both the read method and the write method (in that order) for the annotation of the given class
|
java.beans.PropertyDescriptor |
findProperty(java.lang.String property)
Finds the property with a given name.
|
static BeanHelper |
forClass(java.lang.Class<?> clazz)
Using this static getter will make use of a static cache internally
|
java.lang.Object |
get(java.lang.Object self,
java.lang.String property)
Reads the value of the given property from the object
|
java.lang.Object |
getQuiet(java.lang.Object self,
java.lang.String property,
LoggerEx log)
Gets the value of a property on a bean.
|
java.lang.Class<?> |
getType() |
void |
set(java.lang.Object self,
java.lang.String property,
java.lang.Object value) |
void |
setQuiet(java.lang.Object self,
java.lang.String property,
java.lang.Object value,
LoggerEx log)
Sets a value for the bean.
|
public BeanHelper(java.lang.Class<?> clazz)
public static BeanHelper forClass(java.lang.Class<?> clazz)
public java.lang.Class<?> getType()
public java.util.List<java.beans.PropertyDescriptor> findAllProperties()
public java.beans.PropertyDescriptor findProperty(java.lang.String property)
public <T extends java.lang.annotation.Annotation> T findAnnotation(java.lang.String property,
java.lang.Class<T> annotationClass)
public java.lang.Object get(java.lang.Object self,
java.lang.String property)
throws java.lang.IllegalAccessException,
java.lang.IllegalArgumentException,
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessExceptionjava.lang.IllegalArgumentExceptionjava.lang.reflect.InvocationTargetExceptionpublic java.lang.Object getQuiet(java.lang.Object self,
java.lang.String property,
LoggerEx log)
public void set(java.lang.Object self,
java.lang.String property,
java.lang.Object value)
throws java.lang.reflect.InvocationTargetException,
java.lang.IllegalAccessException,
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetExceptionjava.lang.IllegalAccessExceptionjava.lang.IllegalArgumentExceptionpublic void setQuiet(java.lang.Object self,
java.lang.String property,
java.lang.Object value,
LoggerEx log)