public abstract class ClassUtils
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
CLASS_FILE_SUFFIX |
The ".class" file suffix
|
static char |
PACKAGE_SEPARATOR_CHAR |
The package separator character '.'
|
| Constructor | Description |
|---|---|
ClassUtils() |
| Modifier and Type | Method | Description |
|---|---|---|
static <T> T |
createInstance(java.lang.Class<T> cls) |
Method that can be called to try to create an instantiate of
specified type.
|
static <T> T |
createInstance(java.lang.Class<T> cls,
java.lang.Object... args) |
Method that can be called to try to create an instantiate of
specified type.
|
static <T> java.lang.reflect.Constructor<T> |
findConstructor(java.lang.Class<T> cls,
java.lang.Class<?>... parameterTypes) |
Obtain an accessible constructor for the given class and parameters.
|
public static final char PACKAGE_SEPARATOR_CHAR
public static final java.lang.String CLASS_FILE_SUFFIX
public static <T> T createInstance(java.lang.Class<T> cls)
T - the generic typecls - the class to checkjava.lang.IllegalArgumentException - if instantiation fails for any reason;
except for cases where constructor throws an unchecked exception
(which will be passed as is)public static <T> T createInstance(java.lang.Class<T> cls,
java.lang.Object... args)
T - the generic typecls - the class to checkargs - the argumentsjava.lang.IllegalArgumentException - if instantiation fails for any reason;
except for cases where constructor throws an unchecked exception
(which will be passed as is)public static <T> java.lang.reflect.Constructor<T> findConstructor(java.lang.Class<T> cls,
java.lang.Class<?>... parameterTypes)
throws java.lang.NoSuchMethodException
T - the generic typecls - the class to checkparameterTypes - the parameter types of the desired constructorjava.lang.NoSuchMethodException - if no such constructor existsCopyright © 2008–2018 The Aspectran Project. All rights reserved.