|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectparser.absconparseur.ReflectionManager
public class ReflectionManager
This class allows performing some operations based on reflection.
Nested Class Summary | |
---|---|
static class |
ReflectionManager.DigestedFields
|
Field Summary | |
---|---|
static char |
JAR_SEPARATOR_CHAR
|
Constructor Summary | |
---|---|
ReflectionManager()
|
Method Summary | |
---|---|
static ReflectionManager.DigestedFields |
getAllFieldsOfFieldOfInheritingFrom(Object object,
Class targetClass)
|
static Object |
getArrayInstance(String className,
int[] lengths)
An array with elements of the given type is built. |
static String[][] |
getDescriptionOfDeclaredFieldsOf(Object object)
Returns a description (names and values) of the fields of the given object. |
static Enumeration |
getEntriesOf(String jarName)
|
static Field |
getFirstFieldOfWithType(Class cl,
Class<?> targetClass)
|
static Class |
getFirstInnerClassOfInheritingFrom(Class cl,
Class<?> targetClass)
|
static Object |
getInstanceOf(Class clazz)
|
static Object |
getInstanceOf(String className)
An object of the class whose name is given is built. |
static Object |
getInstanceOf(String className,
Class rootClass)
An object of the class whose name is given is built. |
static Object |
getInstanceOf(String className,
Object[] objects)
An object of the class whose name is given is built. |
static String |
getStringConcatenationOfDeclaredFieldsOf(Object object)
|
static Object |
invokeStaticMethod(String className,
String methodName)
|
static String |
searchAbsoluteNameOf(String basicPackage,
String className)
Returns the absolute name of the class whose name is given. |
static Class[] |
searchClassesInheritingFrom(Class rootClass,
int requiredModifiers,
int forbiddenModifiers)
Returns all classes that inherit from the given root class (by considering the CLASSPATH environment variable). |
static List<Class> |
searchClassesInheritingFromIn(Class rootClass,
File directory,
int requiredModifiers,
int forbiddenModifiers)
Returns a list of all (not abstract) classes which inherit from the given root class and which can be found from the given directory. |
static Constructor |
searchFirstConstructor(Class clazz,
int modifiers)
|
static Constructor[] |
searchFirstConstructors(Class[] classes,
int modifiers)
|
static Method |
searchMethod(Class clazz,
String methodName,
int modifiers)
|
static Method[] |
searchMethods(Class[] classes,
String methodName,
int modifiers)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final char JAR_SEPARATOR_CHAR
Constructor Detail |
---|
public ReflectionManager()
Method Detail |
---|
public static Class getFirstInnerClassOfInheritingFrom(Class cl, Class<?> targetClass)
public static List<Class> searchClassesInheritingFromIn(Class rootClass, File directory, int requiredModifiers, int forbiddenModifiers)
rootClass
- a given classdirectory
- a given directoryrequiredModifiers
- a propagationSet of required modifiers for all subclassesforbiddenModifiers
- a propagationSet of forbidden modifiers for all subclassespublic static Enumeration getEntriesOf(String jarName)
public static Class[] searchClassesInheritingFrom(Class rootClass, int requiredModifiers, int forbiddenModifiers)
rootClass
- a given classrequiredModifiers
- a set of required modifiers for all subclassesforbiddenModifiers
- a set of forbidden modifiers for all subclassespublic static Field getFirstFieldOfWithType(Class cl, Class<?> targetClass)
public static ReflectionManager.DigestedFields getAllFieldsOfFieldOfInheritingFrom(Object object, Class targetClass)
public static String[][] getDescriptionOfDeclaredFieldsOf(Object object)
public static String getStringConcatenationOfDeclaredFieldsOf(Object object)
public static String searchAbsoluteNameOf(String basicPackage, String className)
basicPackage
- the (absolute) name of a packageclassName
- the name of a class that must be found in the package (or subpackages) whose name is givenpublic static Method searchMethod(Class clazz, String methodName, int modifiers)
public static Method[] searchMethods(Class[] classes, String methodName, int modifiers)
public static Constructor searchFirstConstructor(Class clazz, int modifiers)
public static Constructor[] searchFirstConstructors(Class[] classes, int modifiers)
public static Object getInstanceOf(Class clazz)
public static Object getInstanceOf(String className)
className
- the name of a class
public static Object invokeStaticMethod(String className, String methodName)
public static Object getInstanceOf(String className, Class rootClass)
className
- the name of a classrootClass
- an ancestor class of the class whose name is given
public static Object getInstanceOf(String className, Object[] objects)
className
- the name of a classobjects
- the parameters used by the constructor
public static Object getArrayInstance(String className, int[] lengths)
className
- the name of a classlengths
- the dimensions of the array
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |