public class BeanIntrospector extends Object
| Constructor and Description |
|---|
BeanIntrospector() |
| Modifier and Type | Method and Description |
|---|---|
static Field |
getFieldByName(Class<?> c,
String fieldName)
Returns the field identified by the given name
|
static BeanGetter[] |
getGetters(Object bean)
Returns all the getters for the given bean class ( methods starting with "get" except "getClass" )
|
static Method[] |
getMethods(Object bean)
Returns all the methods of the given bean class
|
static BeanSetter[] |
getSetters(Object bean)
Returns all the setters for the given bean class ( methods starting with "set" )
|
static Object |
invokeGetter(Object instance,
String getterName) |
static <T> T |
invokeGetter(Object instance,
String getterName,
Class<T> expectedClass) |
static boolean |
isGetter(Method m)
Returns true if the given method is a "getter" :
starts with "get", no parameter, not "getClass", name length > 3 |
static boolean |
isSetter(Method m)
Returns true if the given method is a "setter" :
starts with "set", one parameter, name length > 3 |
public static final Method[] getMethods(Object bean)
bean - public static final boolean isGetter(Method m)
m - public static final boolean isSetter(Method m)
m - public static final BeanGetter[] getGetters(Object bean)
bean - public static final BeanSetter[] getSetters(Object bean)
bean - public static Field getFieldByName(Class<?> c, String fieldName) throws SecurityException, NoSuchFieldException
c - fieldName - SecurityExceptionNoSuchFieldExceptionCopyright © 2016. All rights reserved.