public final class BeanUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static PropertyDescriptor |
getPropertyDescriptor(Class beanClass,
String property)
Gets the property descriptor for the property name from given class.
|
static Class |
getPropertyType(Class beanClass,
String property)
Gets the return type of property.
|
static Object |
getPropertyValue(Object bean,
String property)
Gets the value of property from the bean object.
|
static boolean |
isPropertyEditable(Class beanClass,
String property)
Checks whether the property is editable or not.
|
static void |
setPropertyValue(Object bean,
String property,
Object value)
Sets the value of property to the object of bean
|
public static final boolean isPropertyEditable(Class beanClass, String property) throws IntrospectionException
beanClass - the class of bean whose property is being inspecting.property - the name of property to inspect.true if the property is editable else falseIntrospectionExceptionpublic static final Class getPropertyType(Class beanClass, String property) throws IntrospectionException
beanClass - the class of bean whose property is being inspecting.property - the name of propertynull if the property name
if not found in bean class.IntrospectionExceptionpublic static final Object getPropertyValue(Object bean, String property) throws IntrospectionException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
bean - the object of bean class whose property is to access.property - the name of property.IntrospectionExceptionIllegalArgumentExceptionIllegalAccessExceptionInvocationTargetExceptionpublic static final void setPropertyValue(Object bean, String property, Object value) throws IntrospectionException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
bean - the bean object whose proeprty is to set.property - the name of property.value - the value to set for the property.IntrospectionExceptionIllegalArgumentExceptionIllegalAccessExceptionInvocationTargetExceptionpublic static final PropertyDescriptor getPropertyDescriptor(Class beanClass, String property) throws IntrospectionException
beanClass - the class of beanproperty - the name of property.null.IntrospectionException