|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.badlogic.gdx.utils.reflect.ClassReflection
public final class ClassReflection
Utilities for Class reflection.
Constructor Summary | |
---|---|
ClassReflection()
|
Method Summary | ||
---|---|---|
static Class |
forName(String name)
Returns the Class object associated with the class or interface with the supplied string name. |
|
static Constructor |
getConstructor(Class c,
Class... parameterTypes)
Returns a Constructor that represents the public constructor for the supplied class which takes the supplied
parameter types. |
|
static Constructor[] |
getConstructors(Class c)
Returns an array of Constructor containing the public constructors of the class represented by the supplied Class. |
|
static Constructor |
getDeclaredConstructor(Class c,
Class... parameterTypes)
Returns a Constructor that represents the constructor for the supplied class which takes the supplied parameter
types. |
|
static Field |
getDeclaredField(Class c,
String name)
Returns a Field that represents the specified declared field for the supplied class. |
|
static Field[] |
getDeclaredFields(Class c)
Returns an array of Field objects reflecting all the fields declared by the supplied class. |
|
static Method |
getDeclaredMethod(Class c,
String name,
Class... parameterTypes)
Returns a Method that represents the method declared by the supplied class which takes the supplied parameter types. |
|
static Method[] |
getDeclaredMethods(Class c)
Returns an array of Method containing the methods declared by the class represented by the supplied Class. |
|
static Field |
getField(Class c,
String name)
Returns a Field that represents the specified public member field for the supplied class. |
|
static Field[] |
getFields(Class c)
Returns an array of Field containing the public fields of the class represented by the supplied Class. |
|
static Method |
getMethod(Class c,
String name,
Class... parameterTypes)
Returns a Method that represents the public member method for the supplied class which takes the supplied parameter
types. |
|
static Method[] |
getMethods(Class c)
Returns an array of Method containing the public member methods of the class represented by the supplied Class. |
|
static String |
getSimpleName(Class c)
Returns the simple name of the underlying class as supplied in the source code. |
|
static boolean |
isAssignableFrom(Class c1,
Class c2)
Determines if the class or interface represented by first Class parameter is either the same as, or is a superclass or superinterface of, the class or interface represented by the second Class parameter. |
|
static boolean |
isInstance(Class c,
Object obj)
Determines if the supplied Object is assignment-compatible with the object represented by supplied Class. |
|
static boolean |
isMemberClass(Class c)
Returns true if the class or interface represented by the supplied Class is a member class. |
|
static boolean |
isStaticClass(Class c)
Returns true if the class or interface represented by the supplied Class is a static class. |
|
static
|
newInstance(Class<T> c)
Creates a new instance of the class represented by the supplied Class. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassReflection()
Method Detail |
---|
public static Class forName(String name) throws ReflectionException
ReflectionException
public static String getSimpleName(Class c)
public static boolean isInstance(Class c, Object obj)
public static boolean isAssignableFrom(Class c1, Class c2)
public static boolean isMemberClass(Class c)
public static boolean isStaticClass(Class c)
public static <T> T newInstance(Class<T> c) throws ReflectionException
ReflectionException
public static Constructor[] getConstructors(Class c)
Constructor
containing the public constructors of the class represented by the supplied Class.
public static Constructor getConstructor(Class c, Class... parameterTypes) throws ReflectionException
Constructor
that represents the public constructor for the supplied class which takes the supplied
parameter types.
ReflectionException
public static Constructor getDeclaredConstructor(Class c, Class... parameterTypes) throws ReflectionException
Constructor
that represents the constructor for the supplied class which takes the supplied parameter
types.
ReflectionException
public static Method[] getMethods(Class c)
Method
containing the public member methods of the class represented by the supplied Class.
public static Method getMethod(Class c, String name, Class... parameterTypes) throws ReflectionException
Method
that represents the public member method for the supplied class which takes the supplied parameter
types.
ReflectionException
public static Method[] getDeclaredMethods(Class c)
Method
containing the methods declared by the class represented by the supplied Class.
public static Method getDeclaredMethod(Class c, String name, Class... parameterTypes) throws ReflectionException
Method
that represents the method declared by the supplied class which takes the supplied parameter types.
ReflectionException
public static Field[] getFields(Class c)
Field
containing the public fields of the class represented by the supplied Class.
public static Field getField(Class c, String name) throws ReflectionException
Field
that represents the specified public member field for the supplied class.
ReflectionException
public static Field[] getDeclaredFields(Class c)
Field
objects reflecting all the fields declared by the supplied class.
public static Field getDeclaredField(Class c, String name) throws ReflectionException
Field
that represents the specified declared field for the supplied class.
ReflectionException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |