|
Dashboard Builder Commons 6.2.0.Beta1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.dashboard.commons.misc.ReflectionUtils
public class ReflectionUtils
| Field Summary | |
|---|---|
static String |
ARRAYS_DELIMITER
|
| Constructor Summary | |
|---|---|
ReflectionUtils()
|
|
| Method Summary | ||
|---|---|---|
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 Field |
getField(Object obj,
String propertyName)
|
|
static String |
getGetMethodName(String fieldName)
Generates the name of a get method for the given field name. |
|
static Method |
getGetter(Object obj,
String propertyName)
|
|
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 Method |
getSetter(Object obj,
Method getter,
String propertyName)
|
|
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)
|
|
static
|
newInstanceForClass(Class<T> type)
|
|
static Object |
parseAndSetFieldValue(Object obj,
String fieldName,
String fieldValue)
|
|
static Object |
parseAndSetFieldValues(Object obj,
String fieldName,
String[] fieldValues)
|
|
static
|
parseValue(String value,
Class<T> type)
|
|
static Object |
setFieldFile(Object obj,
String fieldName,
File fieldValue)
|
|
static Object |
setFieldValue(Object obj,
String fieldName,
Object fieldValue)
|
|
static Object[] |
toArray(String value,
Class type)
|
|
static boolean |
toBoolean(String parameter)
|
|
static byte |
toByte(String parameter)
|
|
static byte[] |
toByteArray(File f)
|
|
static char |
toChar(String parameter)
|
|
static double |
toDouble(String parameter)
|
|
static Object |
toFile(String paramValue)
|
|
static float |
toFloat(String parameter)
|
|
static int |
toInt(String parameter)
|
|
static long |
toLong(String parameter)
|
|
static short |
toShort(String parameter)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ARRAYS_DELIMITER
| Constructor Detail |
|---|
public ReflectionUtils()
| Method Detail |
|---|
public static Object getPrivateField(Object o,
String fieldName)
public static Object invokeMethod(Object o,
String methodName,
Object[] params)
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 Class[] getClassHierarchyInterfaces(Class clazz)
public static final String getGetMethodName(String fieldName)
fieldName - the field name to generate a method name for
public static final String getSetMethodName(String fieldName)
fieldName - the field name to generate a method name for
public static final boolean isSetMethod(Method method)
method - the Method to check
public static final boolean isGetMethod(Method method)
method - the Method to check
public static final boolean isIsMethod(Method method)
method - the Method to check
public static Object parseAndSetFieldValues(Object obj,
String fieldName,
String[] fieldValues)
throws Exception
Exception
public static Object parseAndSetFieldValue(Object obj,
String fieldName,
String fieldValue)
throws Exception
Exception
public static Object setFieldValue(Object obj,
String fieldName,
Object fieldValue)
throws Exception
Exception
public static Object setFieldFile(Object obj,
String fieldName,
File fieldValue)
throws Exception
Exception
public static Field getField(Object obj,
String propertyName)
public static Method getGetter(Object obj,
String propertyName)
public static Method getSetter(Object obj,
Method getter,
String propertyName)
public static <T> T newInstanceForClass(Class<T> type)
public static <T> T parseValue(String value,
Class<T> type)
throws Exception
Exception
public static Object[] toArray(String value,
Class type)
throws Exception
Exception
public static int toInt(String parameter)
throws Exception
Exception
public static boolean toBoolean(String parameter)
throws Exception
Exception
public static long toLong(String parameter)
throws Exception
Exception
public static char toChar(String parameter)
throws Exception
Exception
public static double toDouble(String parameter)
throws Exception
Exception
public static float toFloat(String parameter)
throws Exception
Exception
public static byte toByte(String parameter)
throws Exception
Exception
public static short toShort(String parameter)
throws Exception
Exceptionpublic static Object toFile(String paramValue)
public static byte[] toByteArray(File f)
throws IOException
IOExceptionpublic static void main(String[] args)
|
Dashboard Builder Commons 6.2.0.Beta1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||