public class TypeReflector extends Object
| Constructor and Description |
|---|
TypeReflector() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
collectionAssignable(Class<?> type)
check if a type is
java.util.Collection type. |
static Constructor<?> |
getConstructor(Class<?> type)
Reflect a constructor of a class.
|
static Class<?> |
getParameterizedType(Field field,
GenericClass generics)
Get parameterized type of a java.util.List field, T of List
|
static Class<?>[] |
getParameterizedTypeArray(Field field,
GenericClass generics)
Get parameterized type of a java.util.List field, T of List
|
static boolean |
isList(Class<?> type)
check if a type is
java.util.List type. |
static boolean |
isMap(Class<?> type)
check if a type is
java.util.Map type. |
static boolean |
isSet(Class<?> type)
check if a type is
java.util.Set type. |
public static Class<?>[] getParameterizedTypeArray(Field field, GenericClass generics)
field - a java.lang.reflect.Field objectpublic static Class<?> getParameterizedType(Field field, GenericClass generics)
field - a java.lang.reflect.Field objectpublic static Constructor<?> getConstructor(Class<?> type) throws Exception
type - a Class typeException - if reflection failspublic static boolean isList(Class<?> type)
java.util.List type.type - a type to be checkedpublic static boolean collectionAssignable(Class<?> type)
java.util.Collection type.type - a type to be checkedpublic static boolean isSet(Class<?> type)
java.util.Set type.type - a type to be checked.public static boolean isMap(Class<?> type)
java.util.Map type.type - a type to be checkedCopyright © 2016. All rights reserved.