|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.gora.util.ReflectionUtils
public class ReflectionUtils
Utility methods related to reflection
Field Summary | |
---|---|
static Class<?>[] |
EMPTY_CLASS_ARRAY
|
static Object[] |
EMPTY_OBJECT_ARRAY
|
Constructor Summary | |
---|---|
ReflectionUtils()
|
Method Summary | ||
---|---|---|
static
|
getConstructor(Class<T> clazz)
Returns the empty argument constructor of the class. |
|
static Object |
getStaticField(Class<?> clazz,
String fieldName)
Returns the value of a named static field |
|
static boolean |
hasConstructor(Class<?> clazz)
Returns whether the class defines an empty argument constructor. |
|
static
|
newInstance(Class<T> clazz)
Constructs a new instance of the class using the no-arg constructor. |
|
static Object |
newInstance(String classStr)
Constructs a new instance of the class using the no-arg constructor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Class<?>[] EMPTY_CLASS_ARRAY
public static Object[] EMPTY_OBJECT_ARRAY
Constructor Detail |
---|
public ReflectionUtils()
Method Detail |
---|
public static <T> Constructor<T> getConstructor(Class<T> clazz) throws SecurityException, NoSuchMethodException
SecurityException
NoSuchMethodException
public static boolean hasConstructor(Class<?> clazz) throws SecurityException, NoSuchMethodException
SecurityException
NoSuchMethodException
public static <T> T newInstance(Class<T> clazz) throws InstantiationException, IllegalAccessException, SecurityException, NoSuchMethodException, IllegalArgumentException, InvocationTargetException
clazz
- the class of the object
InstantiationException
IllegalAccessException
SecurityException
NoSuchMethodException
IllegalArgumentException
InvocationTargetException
public static Object newInstance(String classStr) throws InstantiationException, IllegalAccessException, ClassNotFoundException, SecurityException, IllegalArgumentException, NoSuchMethodException, InvocationTargetException
classStr
- the class name of the object
InstantiationException
IllegalAccessException
ClassNotFoundException
SecurityException
IllegalArgumentException
NoSuchMethodException
InvocationTargetException
public static Object getStaticField(Class<?> clazz, String fieldName) throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException
IllegalArgumentException
SecurityException
IllegalAccessException
NoSuchFieldException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |