|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.utils.ClassHelpers
public class ClassHelpers
Java class helpers.
Provides methods for unmangling class names and retrieving information about classes (subclasses, interfaces implemented, etc.).
See also DynamicCall
which allows dynamic loading of a
class method with parameters from a named class.
Constructor Summary | |
---|---|
ClassHelpers()
|
Method Summary | |
---|---|
static boolean |
classImplements(java.lang.String className,
java.lang.String interfaceName)
Check if class implements specified interface. |
static java.lang.String[] |
getClasses(java.lang.Class infoClass)
Get classes for a class. |
static java.lang.String[] |
getConstructors(java.lang.Class infoClass)
Gets constructors for a class. |
static java.lang.String[] |
getFields(java.lang.Class infoClass)
Get fields for a class. |
static java.lang.String[] |
getInterfaces(java.lang.Class infoClass)
Gets interfaces for a class. |
static java.lang.String[] |
getMethods(java.lang.Class infoClass)
Get methods for a class. |
static java.lang.String[] |
getSigners(java.lang.Class infoClass)
Get signers for a class. |
static java.lang.String |
trimClassName(java.lang.String name)
Removes class modifiers, leaving only the class name. |
static java.lang.String |
unmangleJavaName(java.lang.String name)
Convert a mangled java name to the normal Java syntax equivalent. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassHelpers()
Method Detail |
---|
public static java.lang.String unmangleJavaName(java.lang.String name)
name
- The mangled name.
Arrays are indicated by one or more '[' characters (the count indicates the number of "[]" pairs), followed by a single upper-case letter denoting the array type.
public static java.lang.String trimClassName(java.lang.String name)
name
- The class name plus modifiers, if any.
public static java.lang.String[] getInterfaces(java.lang.Class infoClass)
infoClass
- Class for which interfaces are wanted.
public static java.lang.String[] getConstructors(java.lang.Class infoClass)
infoClass
- Class for which constructors are wanted.
public static java.lang.String[] getMethods(java.lang.Class infoClass)
infoClass
- Class for which methods are wanted.
public static java.lang.String[] getFields(java.lang.Class infoClass)
infoClass
- Class for which fields are wanted.
public static java.lang.String[] getSigners(java.lang.Class infoClass)
infoClass
- Class for which signers are wanted.
public static java.lang.String[] getClasses(java.lang.Class infoClass)
infoClass
- Class for which classes are wanted.
public static boolean classImplements(java.lang.String className, java.lang.String interfaceName) throws java.lang.ClassNotFoundException
className
- Class name.interfaceName
- Interface name.
java.lang.ClassNotFoundException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |