|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjp.develop.common.util.amf.beans.ClassUtil
public final class ClassUtil
Utilities for class operation.
| Method Summary | ||
|---|---|---|
static Class<?> |
findClass(String name)
Find class instance by class name. |
|
static Class<?> |
getRawClass(Type type)
Get Raw Class from Type. |
|
static boolean |
isAssignable(Type fromType,
Type toType)
Is assignable? This method check not only Class.isAssignableFrom(), but also actual type arguments of parameterized type. |
|
static
|
newInstance(Class<T> clazz)
Constructs a new instance. |
|
static Type |
resolveActualFieldClass(Type parent,
Field field)
Resolve actual field class by field instance. |
|
static Type |
resolveActualFieldType(Type parent,
Field field)
Resolve actual field type by field instance. |
|
static Type |
resolveActualFieldType(Type parent,
String fieldName)
Resolve actual field type by name. |
|
static Type |
resolveActualParameterClass(Type parent,
Method method,
int paramIndex)
Resolve actual parameter class by method instance and parameter index. |
|
static Type |
resolveActualParameterType(Type parent,
Method method,
int paramIndex)
Resolve actual parameter type by method instance and parameter index. |
|
static Type[] |
resolveActualParameterTypes(Type parent,
Method method)
Resolve actual parameter types by method instance. |
|
static Type[] |
resolveActualParameterTypes(Type parent,
String methodName,
Class<?>... parameterClasses)
Resolve actual parameter types by method name. |
|
static Class<?> |
resolveActualReturnClass(Type parent,
Method method)
Resolve actual return class by method instance. |
|
static Type |
resolveActualReturnType(Type parent,
Method method)
Resolve actual return type by method instance. |
|
static Type |
resolveActualReturnType(Type parent,
String methodName,
Class<?>... parameterClasses)
Resolve actual return type by method name. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Class<?> findClass(String name)
name - The class name to find.
public static <T> T newInstance(Class<T> clazz)
T - Type of a instance.clazz - The class to be instantiated.
public static Class<?> getRawClass(Type type)
type - Target type.
public static boolean isAssignable(Type fromType,
Type toType)
fromType - Type of assigning from.toType - Type of assigning to.
public static Type resolveActualFieldType(Type parent,
String fieldName)
parent - Type of parent.fieldName - The field name to be resolved.
public static Type resolveActualFieldType(Type parent,
Field field)
parent - Type of parent.field - The field to be resolved.
public static Type resolveActualFieldClass(Type parent,
Field field)
parent - Type of parent.field - The field to be resolved.
public static Type[] resolveActualParameterTypes(Type parent,
String methodName,
Class<?>... parameterClasses)
parent - Type of parent.methodName - The method name to be resolved.parameterClasses - The classes of the method parameter.
public static Type[] resolveActualParameterTypes(Type parent,
Method method)
parent - Type of parent.method - The method to be resolved.
public static Type resolveActualParameterType(Type parent,
Method method,
int paramIndex)
parent - Type of parent.method - The method to be resolved.paramIndex - The index of target parameter.
public static Type resolveActualParameterClass(Type parent,
Method method,
int paramIndex)
parent - Type of parent.method - The method to be resolved.paramIndex - The index of target parameter.
public static Type resolveActualReturnType(Type parent,
String methodName,
Class<?>... parameterClasses)
parent - Type of parent.methodName - The method name to be resolved.parameterClasses - The classes of the method parameter.
public static Type resolveActualReturnType(Type parent,
Method method)
parent - Type of parent.method - The method to be resolved.
public static Class<?> resolveActualReturnClass(Type parent,
Method method)
parent - Type of parent.method - The method to be resolved.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||