public final class BeanUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static Optional<Class> |
classForName(String name)
Gets the class by the given name as an optional instance.
|
static Method |
getGetter(Object object,
String field)
Gets the getter method of the specified property.
|
static Object |
getProperty(Object object,
String field)
Gets the value of the specified property.
|
static Method |
getSetter(Object object,
String field) |
static boolean |
isSetter(Method method) |
static void |
setProperty(Object object,
String field,
Object value) |
public static Method getGetter(Object object, String field) throws NoSuchMethodException
object - The object containing the property.field - The property name.NoSuchMethodException - If no such getter exists.public static Object getProperty(Object object, String field) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
object - The object containing the property.field - The property name.NoSuchMethodException - If no such property exists.InvocationTargetException - If an error occurs while getting the value.IllegalAccessException - If it is not possible to access the property.public static Method getSetter(Object object, String field) throws NoSuchMethodException
NoSuchMethodExceptionpublic static void setProperty(Object object, String field, Object value) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
public static boolean isSetter(Method method)
Copyright © 2018. All rights reserved.