cookxml.core.util
Class ClassUtils
java.lang.Object
cookxml.core.util.ClassUtils
- public class ClassUtils
- extends Object
A collection of reflection/class utilities.
- Since:
- CookXml 1.0
Method Summary |
static Object |
getArray(Class cl,
int length)
|
static Object |
getArray(String name,
int length)
|
static Object |
getConstantValue(Class targetClass,
String fieldName)
|
static Class |
getEquivalentClass(Class srcClass)
|
static Class |
getEquivalentClass(String srcClassName)
|
static Object |
getField(Object obj,
String fieldName)
|
static Object |
getField(Object obj,
String fieldName,
boolean accessible)
|
static void |
setArray(Object array,
int size,
Collection collection)
|
static void |
setField(Object obj,
String fieldName,
Object value)
|
static void |
setField(Object obj,
String fieldName,
Object value,
boolean accessible)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
THIS_VAR
public static final String THIS_VAR
- See Also:
- Constant Field Values
NULL_VAR
public static final String NULL_VAR
- See Also:
- Constant Field Values
ClassUtils
public ClassUtils()
getEquivalentClass
public static Class getEquivalentClass(Class srcClass)
getEquivalentClass
public static Class getEquivalentClass(String srcClassName)
getArray
public static Object getArray(String name,
int length)
throws ArrayException
- Throws:
ArrayException
getArray
public static Object getArray(Class cl,
int length)
throws ArrayException
- Throws:
ArrayException
setArray
public static void setArray(Object array,
int size,
Collection collection)
getField
public static Object getField(Object obj,
String fieldName)
throws NoSuchFieldException,
IllegalAccessException
- Throws:
NoSuchFieldException
IllegalAccessException
getField
public static Object getField(Object obj,
String fieldName,
boolean accessible)
throws NoSuchFieldException,
IllegalAccessException,
SecurityException
- Throws:
NoSuchFieldException
IllegalAccessException
SecurityException
setField
public static void setField(Object obj,
String fieldName,
Object value)
throws NoSuchFieldException,
IllegalAccessException
- Throws:
NoSuchFieldException
IllegalAccessException
setField
public static void setField(Object obj,
String fieldName,
Object value,
boolean accessible)
throws NoSuchFieldException,
IllegalAccessException,
SecurityException
- Throws:
NoSuchFieldException
IllegalAccessException
SecurityException
getConstantValue
public static Object getConstantValue(Class targetClass,
String fieldName)