|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.riotfamily.common.beans.PropertyUtils
public final class PropertyUtils
Utility class to access bean properties via relection.
Method Summary | ||
---|---|---|
static
|
convert(String s,
Class<T> targetClass)
|
|
static String |
convertToString(Object value)
|
|
static ObjectWrapper |
createWrapper(Object obj)
|
|
static String |
evaluate(String expression,
Object bean)
|
|
static Method |
findReadMethod(Class<?> clazz,
String property)
|
|
static Method |
findWriteMethod(Class<?> clazz,
String property)
|
|
static Class<?> |
getDeclaringClass(Class<?> clazz,
String property)
Returns the (super-)class where the given property is declared. |
|
static Map<String,Object> |
getProperties(Object bean)
Returns a Map containing the bean's properties. |
|
static Map<String,Object> |
getProperties(Object bean,
String[] propertyNames)
Returns a Map containing the bean's properties. |
|
static Object |
getProperty(Object bean,
String name)
|
|
static
|
getProperty(Object bean,
String name,
Class<T> requiredType)
|
|
static String |
getPropertyAsString(Object bean,
String name)
|
|
static Class<?> |
getPropertyType(Class<?> clazz,
String propertyPath)
|
|
static void |
setProperties(Object bean,
Map<String,?> properties)
Sets properties from the given Map. |
|
static void |
setProperty(Object bean,
String name,
Object value)
|
|
static void |
setPropertyAsString(Object bean,
String name,
String s)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ObjectWrapper createWrapper(Object obj)
public static Object getProperty(Object bean, String name)
public static <T> T getProperty(Object bean, String name, Class<T> requiredType)
public static String getPropertyAsString(Object bean, String name)
public static void setProperty(Object bean, String name, Object value)
public static void setPropertyAsString(Object bean, String name, String s)
public static Map<String,Object> getProperties(Object bean)
public static Map<String,Object> getProperties(Object bean, String[] propertyNames)
public static void setProperties(Object bean, Map<String,?> properties)
MutablePropertyValues.addPropertyValues(Map)
public static String evaluate(String expression, Object bean)
public static <T> T convert(String s, Class<T> targetClass)
public static String convertToString(Object value)
public static Class<?> getPropertyType(Class<?> clazz, String propertyPath)
public static Method findReadMethod(Class<?> clazz, String property)
public static Method findWriteMethod(Class<?> clazz, String property)
public static Class<?> getDeclaringClass(Class<?> clazz, String property)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |