|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.glaivestone.javax.lang.ClassX
General-purpose extensions to the standard Class services.
Provides general-purpose convenience services to support common usage patterns for Java reflection
| Field Summary | |
static java.util.List |
PRIMITIVE_TYPE_NAMES
List containing the names of the Java primitive types |
| Method Summary | |
static java.lang.Class |
classForNameOrNull(java.lang.String className)
Answer the Class identified by the fully qualified class name. |
static java.lang.reflect.Method |
getMethodOrNull(java.lang.Class aClass,
java.lang.String messageName,
java.lang.Class[] parmTypes)
Answer the public method supported by the specified class with the given name and parameter type signature. |
static java.lang.String |
getPackageName(java.lang.Class aClass)
Answer the package name of the class. |
static java.lang.String |
getPackageName(java.lang.String fullyQualifiedName)
Answer the package name of a fully qualified class name. |
static java.lang.String |
getSimpleName(java.lang.Class aClass)
Answer the simple (unqualified) name of the class. |
static java.lang.String |
getSimpleName(java.lang.String fullyQualifiedName)
Answer the simple (unqualified) name of the class from its fully qualified class name. |
static boolean |
isPrimitiveType(java.lang.String typeName)
Answer whether a type name refers to a primitive type. |
static boolean |
isProperSubclass(java.lang.Class aClass,
java.lang.Class baseClass)
Answer whether a class is a proper subclass of a specified base class. |
static java.lang.Object |
newInstanceOrNull(java.lang.Class aClass)
Create and return a new instance of the specified Class
Return null if an instance cannot be created. |
static java.lang.Object |
newInstanceOrNull(java.lang.String className)
Create and return a new instance of the class identified by the fully qualified class name. |
static java.lang.String |
toSignatureDescription(java.lang.reflect.Method aMethod)
Answer a description of the message signature of a method. |
static java.lang.String |
toSignatureDescription(java.lang.String messageName,
java.lang.Class[] parmTypes,
java.lang.Class returnType)
Answer a description of the signature of a message with the given parameter and return types. |
static java.lang.String |
toSimpleSignatureDescription(java.lang.reflect.Method aMethod)
Answer a description of the message signature of a method. |
static java.lang.String |
toSimpleSignatureDescription(java.lang.String messageName,
java.lang.Class[] parmTypes,
java.lang.Class returnType)
Answer a description of the signature of a message with the given parameter and return types. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.util.List PRIMITIVE_TYPE_NAMES
| Method Detail |
public static java.lang.Class classForNameOrNull(java.lang.String className)
Class identified by the fully qualified class name.
Returns null if the class does not exist or cannot be loaded.
Exceptions raised by the standard Class.forName
operation are suppressed; Use this convenience operation
when you just know it's gonna work or if you don't care why not
if it doesn't.
Class.forName(String)
public static java.lang.reflect.Method getMethodOrNull(java.lang.Class aClass,
java.lang.String messageName,
java.lang.Class[] parmTypes)
The parameter types array can be null for for no-argument message.
Exceptions raised by the standard getMethod
operation are suppressed; Use this convenience operation
when you just know it's gonna work or if you don't care why not
if it doesn't.
Class.getMethod(String, Class[])public static java.lang.String getPackageName(java.lang.Class aClass)
public static java.lang.String getPackageName(java.lang.String fullyQualifiedName)
public static java.lang.String getSimpleName(java.lang.Class aClass)
public static java.lang.String getSimpleName(java.lang.String fullyQualifiedName)
public static boolean isPrimitiveType(java.lang.String typeName)
typeName - the type name to test
boolean indicating whether typeName
is the name of a primitive type
public static boolean isProperSubclass(java.lang.Class aClass,
java.lang.Class baseClass)
This is a predicate for working with (concrete) classes and is not the same as testing for sub-type relationships, such as might be done with interfaces rather than actual backing classes.
aClass - the Class to be checkedbaseClass - the base Class
boolean indicating whether aClass
is a proper subclass of baseClasspublic static java.lang.Object newInstanceOrNull(java.lang.String className)
null if an instance cannot be created.
Exceptions raised by the standard Class.newInstance
operation are suppressed; Use this convenience operation
when you just know in your heart that it's gonna work or
if you just don't care why not if it doesn't.
newInstanceOrNull(java.lang.Class)public static java.lang.Object newInstanceOrNull(java.lang.Class aClass)
Class
Return null if an instance cannot be created.
Exceptions raised by the standard newInstance
operation are suppressed; Use this convenience operation
when you just know in your heart that it's gonna work or
if you just don't care why not if it doesn't.
*
Class.newInstance()public static java.lang.String toSignatureDescription(java.lang.reflect.Method aMethod)
public static java.lang.String toSignatureDescription(java.lang.String messageName,
java.lang.Class[] parmTypes,
java.lang.Class returnType)
public static java.lang.String toSimpleSignatureDescription(java.lang.reflect.Method aMethod)
public static java.lang.String toSimpleSignatureDescription(java.lang.String messageName,
java.lang.Class[] parmTypes,
java.lang.Class returnType)
|
GFL 1.1 API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||