public class BeanUtils
extends java.lang.Object
Created: 2008. 04. 22 PM 3:47:15
Constructor | Description |
---|---|
BeanUtils() |
Modifier and Type | Method | Description |
---|---|---|
static java.lang.Class<?> |
getClassPropertyTypeForGetter(java.lang.Class<?> type,
java.lang.String name) |
Returns the class that the getter will return when reading a property value.
|
static java.lang.Class<?> |
getClassPropertyTypeForSetter(java.lang.Class<?> type,
java.lang.String name) |
Returns the class that the setter expects to receive as a parameter when
setting a property value.
|
static java.lang.Object |
getIndexedProperty(java.lang.Object bean,
java.lang.String indexedName) |
|
static java.lang.Class<?> |
getIndexedType(java.lang.Object bean,
java.lang.String indexedName) |
|
static java.lang.Object |
getProperty(java.lang.Class<?> beanClass,
java.lang.String name) |
Invokes the static method of the specified class to get the bean property value.
|
static java.lang.Object |
getProperty(java.lang.Object bean,
java.lang.String name) |
Return the value of the specified property of the specified bean,
no matter which property reference format is used, with no type
conversions.
|
static java.lang.Class<?> |
getPropertyTypeForGetter(java.lang.Object bean,
java.lang.String name) |
Returns the class that the getter will return when reading a property value.
|
static java.lang.Class<?> |
getPropertyTypeForSetter(java.lang.Object bean,
java.lang.String name) |
Returns the class that the setter expects to receive as a parameter when
setting a property value.
|
static java.lang.String[] |
getReadablePropertyNames(java.lang.Object bean) |
Returns an array of the readable properties exposed by a bean.
|
static java.lang.String[] |
getReadablePropertyNamesWithoutNonSerializable(java.lang.Object bean) |
Returns an array of readable properties exposed by the bean,
except those specified by NonSerializable.
|
static java.lang.Object |
getSimpleProperty(java.lang.Object bean,
java.lang.String name) |
Return the value of the specified property of the specified bean,
no matter which property reference format is used, with no type
conversions.
|
static java.lang.String[] |
getWritablePropertyNames(java.lang.Object bean) |
Returns an array of the writable properties exposed by a bean.
|
static boolean |
hasReadableProperty(java.lang.Class<?> beanClass,
java.lang.String name) |
|
static boolean |
hasReadableProperty(java.lang.Object bean,
java.lang.String name) |
Checks to see if a bean has a readable property be a given name.
|
static boolean |
hasStaticReadableProperty(java.lang.Class<?> beanClass,
java.lang.String name) |
|
static boolean |
hasStaticWritableProperty(java.lang.Class<?> beanClass,
java.lang.String name) |
|
static boolean |
hasWritableProperty(java.lang.Class<?> beanClass,
java.lang.String name) |
|
static boolean |
hasWritableProperty(java.lang.Object bean,
java.lang.String name) |
Checks to see if a bean has a writable property be a given name.
|
static void |
setIndexedProperty(java.lang.Object bean,
java.lang.String indexedName,
java.lang.Object value) |
|
static void |
setProperty(java.lang.Class<?> beanClass,
java.lang.String name,
java.lang.Object value) |
Invokes the static method of the specified class to get the bean property value.
|
static void |
setProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value) |
Sets the value of the specified property of the specified bean.
|
static void |
setSimpleProperty(java.lang.Object bean,
java.lang.String name,
java.lang.Object value) |
Sets the value of the specified property of the specified bean.
|
public static java.lang.Object getProperty(java.lang.Class<?> beanClass, java.lang.String name) throws java.lang.reflect.InvocationTargetException
beanClass
- the class for which to lookupname
- the property namejava.lang.reflect.InvocationTargetException
- if the property accessor method throws an exceptionpublic static void setProperty(java.lang.Class<?> beanClass, java.lang.String name, java.lang.Object value) throws java.lang.reflect.InvocationTargetException
beanClass
- the class for which to lookupname
- the property namevalue
- the value to which this property is to be setjava.lang.reflect.InvocationTargetException
- if the property accessor method throws an exceptionpublic static boolean hasReadableProperty(java.lang.Class<?> beanClass, java.lang.String name)
public static boolean hasWritableProperty(java.lang.Class<?> beanClass, java.lang.String name)
public static boolean hasStaticReadableProperty(java.lang.Class<?> beanClass, java.lang.String name)
public static boolean hasStaticWritableProperty(java.lang.Class<?> beanClass, java.lang.String name)
public static java.lang.Object getProperty(java.lang.Object bean, java.lang.String name) throws java.lang.reflect.InvocationTargetException
bean
- the bean whose property is to be extractedname
- possibly indexed and/or nested name of the property to be extractedjava.lang.reflect.InvocationTargetException
- if the property accessor method throws an exceptionpublic static java.lang.Object getSimpleProperty(java.lang.Object bean, java.lang.String name) throws java.lang.reflect.InvocationTargetException
bean
- the bean whose property is to be extractedname
- the name of the property to be extracted that does not allow nestingjava.lang.reflect.InvocationTargetException
- if the property accessor method throws an exceptionpublic static void setProperty(java.lang.Object bean, java.lang.String name, java.lang.Object value) throws java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException
bean
- the bean whose property is to be modifiedname
- possibly indexed and/or nested name of the property to be modifiedvalue
- the value to which this property is to be setjava.lang.reflect.InvocationTargetException
- if the property accessor method throws an exceptionjava.lang.NoSuchMethodException
- if an accessor method for this property cannot be foundpublic static void setSimpleProperty(java.lang.Object bean, java.lang.String name, java.lang.Object value) throws java.lang.reflect.InvocationTargetException
bean
- the bean whose property is to be modifiedname
- the name of the property to be modified that does not allow nestingvalue
- the value to which this property is to be setjava.lang.reflect.InvocationTargetException
- if the property accessor method throws an exceptionpublic static java.lang.Object getIndexedProperty(java.lang.Object bean, java.lang.String indexedName) throws java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
public static java.lang.Class<?> getIndexedType(java.lang.Object bean, java.lang.String indexedName) throws java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
public static void setIndexedProperty(java.lang.Object bean, java.lang.String indexedName, java.lang.Object value) throws java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
public static boolean hasWritableProperty(java.lang.Object bean, java.lang.String name) throws java.lang.NoSuchMethodException
bean
- the bean to checkname
- the property name to check forjava.lang.NoSuchMethodException
- if an accessor method for this property cannot be foundpublic static boolean hasReadableProperty(java.lang.Object bean, java.lang.String name) throws java.lang.NoSuchMethodException
bean
- the bean to checkname
- the property name to check forjava.lang.NoSuchMethodException
- if an accessor method for this property cannot be foundpublic static java.lang.Class<?> getPropertyTypeForSetter(java.lang.Object bean, java.lang.String name) throws java.lang.NoSuchMethodException
bean
- the bean to checkname
- the name of the propertyjava.lang.NoSuchMethodException
- if an accessor method for this property cannot be foundpublic static java.lang.Class<?> getPropertyTypeForGetter(java.lang.Object bean, java.lang.String name) throws java.lang.NoSuchMethodException
bean
- the bean to checkname
- the name of the propertyjava.lang.NoSuchMethodException
- if an accessor method for this property cannot be foundpublic static java.lang.Class<?> getClassPropertyTypeForGetter(java.lang.Class<?> type, java.lang.String name) throws java.lang.NoSuchMethodException
type
- the class to checkname
- the name of the propertyjava.lang.NoSuchMethodException
- if an accessor method for this property cannot be foundpublic static java.lang.Class<?> getClassPropertyTypeForSetter(java.lang.Class<?> type, java.lang.String name) throws java.lang.NoSuchMethodException
type
- The class to checkname
- the name of the propertyjava.lang.NoSuchMethodException
- if an accessor method for this property cannot be foundpublic static java.lang.String[] getReadablePropertyNames(java.lang.Object bean)
bean
- the beanpublic static java.lang.String[] getReadablePropertyNamesWithoutNonSerializable(java.lang.Object bean)
bean
- the beanpublic static java.lang.String[] getWritablePropertyNames(java.lang.Object bean)
bean
- the beanCopyright © 2008–2018 The Aspectran Project. All rights reserved.