public final class TypeResolver extends Object
Modifier and Type | Class and Description |
---|---|
static class |
TypeResolver.Unknown
An unknown type.
|
Modifier and Type | Field and Description |
---|---|
static Class |
ClassBigDecimal |
static Class |
ClassBigInteger |
static Class |
ClassCalendar |
static Class |
ClassLangString |
static Class |
ClassSQLDate |
static Class |
ClassTimestamp |
static Class |
ClassUtilDate |
Modifier and Type | Method and Description |
---|---|
static void |
disableCache()
Disables the internal caching of resolved TypeVariables.
|
static void |
enableCache()
Enables the internal caching of resolved TypeVariables.
|
static Class |
getClassForName(String sClassName) |
static boolean |
isOfStandardType(Object obj) |
static Type |
resolveBound(TypeVariable<?> typeVariable)
Resolves the first bound for the
typeVariable , returning Unknown.class if none can be resolved. |
static Type |
resolveGenericType(Class<?> type,
Type subType)
Returns the generic
type using type variable information from the subType else null if the
generic type cannot be resolved. |
static <T,S extends T> |
resolveRawArgument(Class<T> type,
Class<S> subType)
Returns the raw class representing the argument for the type using type variable information from the
subType . |
static Class<?> |
resolveRawArgument(Type genericType,
Class<?> subType)
Returns the raw class representing the argument for the genericType using type variable information from
the subType.
|
static <T,S extends T> |
resolveRawArguments(Class<T> type,
Class<S> subType)
Returns an array of raw classes representing arguments for the type using type variable information from
the subType.
|
static Class<?>[] |
resolveRawArguments(Type genericType,
Class<?> subType)
Returns an array of raw classes representing arguments for the genericType using type variable information
from the subType.
|
static Class<?> |
resolveRawClass(Type genericType,
Class<?> subType)
Resolves the raw class for the
genericType , using the type variable information from the subType
else TypeResolver.Unknown if the raw class cannot be resolved. |
public static final Class ClassLangString
public static final Class ClassUtilDate
public static final Class ClassSQLDate
public static final Class ClassTimestamp
public static final Class ClassCalendar
public static final Class ClassBigInteger
public static final Class ClassBigDecimal
public static void enableCache()
public static void disableCache()
public static <T,S extends T> Class<?> resolveRawArgument(Class<T> type, Class<S> subType)
subType
. If no arguments can be resolved then Unknown.class is returned.type
- to resolve argument forsubType
- to extract type variable information fromIllegalArgumentException
- if more or less than one argument is resolved for the typepublic static Class<?> resolveRawArgument(Type genericType, Class<?> subType)
genericType
- to resolve argument forsubType
- to extract type variable information fromIllegalArgumentException
- if more or less than one argument is resolved for the genericTypepublic static <T,S extends T> Class<?>[] resolveRawArguments(Class<T> type, Class<S> subType)
type
- to resolve arguments forsubType
- to extract type variable information frompublic static Class<?>[] resolveRawArguments(Type genericType, Class<?> subType)
genericType
- to resolve arguments forsubType
- to extract type variable information frompublic static Type resolveGenericType(Class<?> type, Type subType)
type
using type variable information from the subType
else null
if the
generic type cannot be resolved.type
- to resolve generic type forsubType
- to extract type variable information fromtype
else null
if it cannot be resolvedpublic static Class<?> resolveRawClass(Type genericType, Class<?> subType)
genericType
, using the type variable information from the subType
else TypeResolver.Unknown
if the raw class cannot be resolved.genericType
- to resolve raw class forsubType
- to extract type variable information fromgenericType
else TypeResolver.Unknown
if it cannot be resolvedpublic static Type resolveBound(TypeVariable<?> typeVariable)
typeVariable
, returning Unknown.class
if none can be resolved.typeVariable
- public static boolean isOfStandardType(Object obj)
obj
- ObjectCopyright © 2001–2019 KnowGate. All rights reserved.