|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.slim3.commons.util.ClassUtil
public final class ClassUtil
A utility class for Class
.
Method Summary | ||
---|---|---|
static Class<?> |
forName(String className)
Returns a class instance. |
|
static Constructor<?> |
getConstructor(Class<?> clazz,
Class<?>... parameterTypes)
Returns the constructor. |
|
static boolean |
isPresent(String className)
Determines if the class is present. |
|
static
|
newInstance(Class<?> clazz)
Creates a new instance. |
|
static
|
newInstance(String className)
Creates a new instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Class<?> forName(String className)
className
- the class name
ClassNotFoundRuntimeException
- if ClassNotFoundException
is encounteredpublic static <T> T newInstance(Class<?> clazz)
T
- the target typeclazz
- the class
InstantiationRuntimeException
- if InstantiationException
is encountered.
IllegalAccessRuntimeException
- if IllegalAccessException
is encountered.public static <T> T newInstance(String className)
T
- the target typeclassName
- the class name
public static Constructor<?> getConstructor(Class<?> clazz, Class<?>... parameterTypes)
clazz
- the target classparameterTypes
- the parameter types.
public static boolean isPresent(String className)
className
- the class name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |