Class OReflectionHelper
java.lang.Object
com.orientechnologies.common.reflection.OReflectionHelper
Helper class to browse .class files. See also:
http://forums.sun.com/thread.jspa?threadID=341935&start=15&tstart=0
- Author:
- Antony Stubbs
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetClassesFor(String iPackageName, ClassLoader iClassLoader) getClassesFor(Collection<String> classNames, ClassLoader classLoader) getClassessOfInterface(String thePackage, Class<?> theInterface, ClassLoader iClassLoader) Filters discovered classes to see if they implement a given interface.static Class<?>Returns the generic class of multi-value objects.static Type[]getGenericTypes(Class<?> iClass) Returns the declared generic types of a class.static booleanisJavaType(Class<?> clazz) Checks if a class is a Java type: Map, Collection,arrays, Number (extensions and primitives), String, Boolean..
-
Constructor Details
-
OReflectionHelper
public OReflectionHelper()
-
-
Method Details
-
getClassesFor
public static List<Class<?>> getClassesFor(Collection<String> classNames, ClassLoader classLoader) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
getClassesFor
public static List<Class<?>> getClassesFor(String iPackageName, ClassLoader iClassLoader) throws ClassNotFoundException - Throws:
ClassNotFoundException
-
getClassessOfInterface
public static List<Class<?>> getClassessOfInterface(String thePackage, Class<?> theInterface, ClassLoader iClassLoader) Filters discovered classes to see if they implement a given interface.- Parameters:
thePackage-theInterface-iClassLoader-- Returns:
- The list of classes that implements the requested interface
-
getGenericTypes
Returns the declared generic types of a class.- Parameters:
iClass- Class to examine- Returns:
- The array of Type if any, otherwise null
-
getGenericMultivalueType
Returns the generic class of multi-value objects.- Parameters:
p- Field to examine- Returns:
- The Class<?> of generic type if any, otherwise null
-
isJavaType
Checks if a class is a Java type: Map, Collection,arrays, Number (extensions and primitives), String, Boolean..- Parameters:
clazz- Class<?> to examine- Returns:
- true if clazz is Java type, false otherwise
-