public class ClassUtil extends Object
| Constructor and Description |
|---|
ClassUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
getArgumentName(Class argumentType)
Returns a suitable argument name for arguments
of type
argumentType. |
static String |
getClassName(Class clazz)
Returns the name of the specified class.
|
static Class[] |
getImplementedInterfaces(Class clazz)
Returns all interfaces implemented by the specified class
including all interfaces implemented by super classes.
|
static Class[] |
getInheritanceHierarchy(Class clazz)
Returns the inheritance hierarchy of the specified class.
|
static String |
getPackageName(Class clazz)
Returns the name of the package of the specified class.
|
static boolean |
isKeyword(String name)
Returns if the specified string is a Java language
keyword.
|
public static String getPackageName(Class clazz)
clazz - the Classpublic static String getClassName(Class clazz)
[] will be
appended to the name (once for each dimension).clazz - the Classpublic static Class[] getImplementedInterfaces(Class clazz)
clazz - the Classpublic static Class[] getInheritanceHierarchy(Class clazz)
java.lang.Object. The returned array also
includes the class itself as the last element. Implemented
interfaces are not included.clazz - the Classpublic static boolean isKeyword(String name)
name - the stringtrue if it is a keyword,
false otherwisepublic static String getArgumentName(Class argumentType)
argumentType. Simply takes
the class name and converts the starting characters
to lower case (by preserving one upper case character).
E.g. the result of JMSTestModule is
jmsTestModule.
If the specified argumentType is an array,
an "s" is appended to the string.
If the resulting string is a Java keyword, "Value"
is appended to the string (which is always the case with
primitive types).argumentType - the argument typeCopyright © 2003-2016. All Rights Reserved.