public class BeanUtils extends Object
| Constructor and Description |
|---|
BeanUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,Object> |
beanToMap(Object bean)
Loads all getters to the Map.
|
static Collection<Method> |
getGetters(Object bean) |
static Method |
getSetter(Object bean,
String attributeName) |
static Collection<Method> |
getSetters(Object bean) |
static void |
mapToBean(Object bean,
Map<String,Object> data,
boolean ignoreNotExistingSetter)
Sets values from map to provided bean.
|
static String |
toAttributeName(Method m)
Extract attribute name from getter or setter.
|
public static Map<String,Object> beanToMap(Object bean) throws InvocationTargetException
InvocationTargetExceptionpublic static void mapToBean(Object bean, Map<String,Object> data, boolean ignoreNotExistingSetter) throws InvocationTargetException, IllegalArgumentException
bean - Set to its settersdata - key is attribute name and value is value to setignoreNotExistingSetter - if false and data contains key which
does not point to any setter then IllegalArgumentException will be thrownInvocationTargetExceptionIllegalArgumentExceptionpublic static Collection<Method> getGetters(Object bean)
public static Collection<Method> getSetters(Object bean)
public static String toAttributeName(Method m) throws IllegalArgumentException
IllegalArgumentExceptionCopyright © 2017–2020 Eclipse Foundation. All rights reserved.