|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsf.qof.util.ReflectionUtils
public final class ReflectionUtils
Utility class for reflection functionality.
| Method Summary | |
|---|---|
static Class<?> |
box(Class<?> type)
Returns the boxed type of a specified primitive type. |
static Method |
findGetter(Class<?> type,
String fieldName)
Returns the getter method for a field name in a specified class. |
static Method |
findSetter(Class<?> type,
String fieldName)
Returns the setter method for a field name in a specified class. |
static Method |
findSetter(Class<?> type,
String fieldName,
Set<Class<?>> mappableTypes)
Returns the setter method for a field name in a specified class that uses a parameter of a type in a set. |
static Class<?> |
getArrayComponentType(Type type)
Returns the array component type of a type. |
static Class<?> |
getCollectionParameterizedKeyType(Type type)
Returns the key type of a parameterized type. |
static Class<?> |
getCollectionParameterizedType(Type type)
Returns the parameterized type of a collection type. |
static Class<?> |
getCollectionType(Type type)
Returns the collection or map type of a type. |
static net.sf.cglib.core.Signature |
getConstructorSignature(Constructor<?> constructor)
Returns a constructor Signature object for a Constructor parameter. |
static net.sf.cglib.core.Signature |
getMethodSignature(Method method)
Returns a method Signature object for a Method parameter. |
static Class<?> |
unbox(Class<?> type)
Returns the unboxed type of a specified type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Method findGetter(Class<?> type,
String fieldName)
type - the classfieldName - field name
public static Method findSetter(Class<?> type,
String fieldName)
type - the classfieldName - field name
public static Method findSetter(Class<?> type,
String fieldName,
Set<Class<?>> mappableTypes)
type - the classfieldName - field namemappableTypes - set of all mappable types
public static Class<?> getCollectionType(Type type)
type - the type
public static Class<?> getArrayComponentType(Type type)
type - the type
public static Class<?> getCollectionParameterizedType(Type type)
type is List<String>
this method returns String. If type is
Map<int, String> it returns String.
type - the parameterized type
ValidationException - if type is not parameterizedpublic static Class<?> getCollectionParameterizedKeyType(Type type)
type is Map<int, String>
it returns int.
type - the parameterized type
public static Class<?> unbox(Class<?> type)
type - the type
public static Class<?> box(Class<?> type)
type - the type
public static net.sf.cglib.core.Signature getMethodSignature(Method method)
Signature object for a Method parameter.
method - the method
public static net.sf.cglib.core.Signature getConstructorSignature(Constructor<?> constructor)
Signature object for a Constructor parameter.
constructor - the constructor
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||