public class ReflectionUtils extends Object
Constructor and Description |
---|
ReflectionUtils() |
Modifier and Type | Method and Description |
---|---|
static List<Field> |
getClassFields(Class clazz,
Class type,
boolean isStatic,
String[] fieldsToIgnore) |
static List<Field> |
getClassHierarchyFields(Class clazz,
Class fieldType,
boolean isStatic,
String[] fieldsToIgnore) |
static Class[] |
getClassHierarchyInterfaces(Class clazz) |
static String |
getGetMethodName(String fieldName)
Generates the name of a get method for the given field name.
|
static Object |
getPrivateField(Object o,
String fieldName) |
static String |
getSetMethodName(String fieldName)
Generates the name of a create method for the given field name.
|
static Object |
invokeMethod(Object o,
String methodName,
Object[] params) |
static boolean |
isGetMethod(Method method)
Checks if the given method is a get method.
|
static boolean |
isIsMethod(Method method)
Checks if the given method is a 'is' method.
|
static boolean |
isSetMethod(Method method)
Checks if the given method is a set method.
|
static void |
main(String[] args) |
public static List<Field> getClassHierarchyFields(Class clazz, Class fieldType, boolean isStatic, String[] fieldsToIgnore)
public static List<Field> getClassFields(Class clazz, Class type, boolean isStatic, String[] fieldsToIgnore)
public static final String getGetMethodName(String fieldName)
fieldName
- the field name to generate a method name forpublic static final String getSetMethodName(String fieldName)
fieldName
- the field name to generate a method name forpublic static final boolean isSetMethod(Method method)
method
- the Method to checkpublic static final boolean isGetMethod(Method method)
method
- the Method to checkpublic static final boolean isIsMethod(Method method)
method
- the Method to checkpublic static void main(String[] args)
Copyright © 2012-2015 JBoss by Red Hat. All Rights Reserved.