类 ResolvableType
- java.lang.Object
- org.springframework.core.ResolvableType
- 所有已实现的接口:
Serializable
public class ResolvableType extends Object implements Serializable
Encapsulates a JavaType
, providing access tosupertypes
,interfaces
, andgeneric parameters
along with the ability to ultimatelyresolve
to aClass
.ResolvableTypes
may be obtained fromfields
,method parameters
,method returns
orclasses
. Most methods on this class will themselves returnResolvableTypes
, allowing easy navigation. For example:private HashMap<Integer, List<String>> myMap; public void example() { ResolvableType t = ResolvableType.forField(getClass().getDeclaredField("myMap")); t.getSuperType(); // AbstractMap<Integer, List<String>> t.asMap(); // Map<Integer, List<String>> t.getGeneric(0).resolve(); // Integer t.getGeneric(1).resolve(); // List t.getGeneric(1); // List<String> t.resolveGeneric(1, 0); // String }
- 从以下版本开始:
- 4.0
- 作者:
- Phillip Webb, Juergen Hoeller, Stephane Nicoll
- 另请参阅:
forField(Field)
,forMethodParameter(Method, int)
,forMethodReturnType(Method)
,forConstructorParameter(Constructor, int)
,forClass(Class)
,forType(Type)
,forInstance(Object)
,ResolvableTypeProvider
, 序列化表格
字段概要
字段 修饰符和类型 字段 说明 static ResolvableType
NONE
ResolvableType
returned when no value is available.
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 ResolvableType
as(Class<?> type)
Return this type as aResolvableType
of the specified class.ResolvableType
asCollection()
Convenience method to return this type as a resolvableCollection
type.ResolvableType
asMap()
Convenience method to return this type as a resolvableMap
type.static void
clearCache()
Clear the internalResolvableType
/SerializableTypeWrapper
cache.boolean
equals(Object other)
static ResolvableType
forArrayComponent(ResolvableType componentType)
Return aResolvableType
as a array of the specifiedcomponentType
.static ResolvableType
forClass(Class<?> clazz)
Return aResolvableType
for the specifiedClass
, using the full generic type information for assignability checks.static ResolvableType
forClass(Class<?> baseType, Class<?> implementationClass)
Return aResolvableType
for the specified base type (interface or base class) with a given implementation class.static ResolvableType
forClassWithGenerics(Class<?> clazz, Class<?>... generics)
Return aResolvableType
for the specifiedClass
with pre-declared generics.static ResolvableType
forClassWithGenerics(Class<?> clazz, ResolvableType... generics)
Return aResolvableType
for the specifiedClass
with pre-declared generics.static ResolvableType
forConstructorParameter(Constructor<?> constructor, int parameterIndex)
Return aResolvableType
for the specifiedConstructor
parameter.static ResolvableType
forConstructorParameter(Constructor<?> constructor, int parameterIndex, Class<?> implementationClass)
Return aResolvableType
for the specifiedConstructor
parameter with a given implementation.static ResolvableType
forField(Field field)
Return aResolvableType
for the specifiedField
.static ResolvableType
forField(Field field, int nestingLevel)
Return aResolvableType
for the specifiedField
with the given nesting level.static ResolvableType
forField(Field field, int nestingLevel, Class<?> implementationClass)
Return aResolvableType
for the specifiedField
with a given implementation and the given nesting level.static ResolvableType
forField(Field field, Class<?> implementationClass)
Return aResolvableType
for the specifiedField
with a given implementation.static ResolvableType
forField(Field field, ResolvableType implementationType)
Return aResolvableType
for the specifiedField
with a given implementation.static ResolvableType
forInstance(Object instance)
Return aResolvableType
for the specified instance.static ResolvableType
forMethodParameter(Method method, int parameterIndex)
Return aResolvableType
for the specifiedMethod
parameter.static ResolvableType
forMethodParameter(Method method, int parameterIndex, Class<?> implementationClass)
Return aResolvableType
for the specifiedMethod
parameter with a given implementation.static ResolvableType
forMethodParameter(MethodParameter methodParameter)
Return aResolvableType
for the specifiedMethodParameter
.static ResolvableType
forMethodParameter(MethodParameter methodParameter, Type targetType)
Return aResolvableType
for the specifiedMethodParameter
, overriding the target type to resolve with a specific given type.static ResolvableType
forMethodParameter(MethodParameter methodParameter, ResolvableType implementationType)
Return aResolvableType
for the specifiedMethodParameter
with a given implementation type.static ResolvableType
forMethodReturnType(Method method)
Return aResolvableType
for the specifiedMethod
return type.static ResolvableType
forMethodReturnType(Method method, Class<?> implementationClass)
Return aResolvableType
for the specifiedMethod
return type.static ResolvableType
forRawClass(Class<?> clazz)
Return aResolvableType
for the specifiedClass
, doing assignability checks against the raw class only (analogous toClass.isAssignableFrom(java.lang.Class<?>)
, which this serves as a wrapper for.static ResolvableType
forType(Type type)
Return aResolvableType
for the specifiedType
.static ResolvableType
forType(Type type, ResolvableType owner)
Return aResolvableType
for the specifiedType
backed by the given owner type.static ResolvableType
forType(ParameterizedTypeReference<?> typeReference)
Return aResolvableType
for the specifiedParameterizedTypeReference
.ResolvableType
getComponentType()
Return the ResolvableType representing the component type of the array orNONE
if this type does not represent an array.ResolvableType
getGeneric(int... indexes)
Return aResolvableType
representing the generic parameter for the given indexes.ResolvableType[]
getGenerics()
Return an array ofResolvableTypes
representing the generic parameters of this type.ResolvableType[]
getInterfaces()
Return aResolvableType
array representing the direct interfaces implemented by this type.ResolvableType
getNested(int nestingLevel)
Return aResolvableType
for the specified nesting level.ResolvableType
getNested(int nestingLevel, Map<Integer,Integer> typeIndexesPerLevel)
Return aResolvableType
for the specified nesting level.Class<?>
getRawClass()
Return the underlying JavaClass
being managed, if available; otherwisenull
.Object
getSource()
Return the underlying source of the resolvable type.ResolvableType
getSuperType()
Return aResolvableType
representing the direct supertype of this type.Type
getType()
Return the underling JavaType
being managed.boolean
hasGenerics()
Returntrue
if this type contains generic parameters.int
hashCode()
boolean
hasUnresolvableGenerics()
Determine whether the underlying type has any unresolvable generics: either through an unresolvable type variable on the type itself or through implementing a generic interface in a raw fashion, i.e. without substituting that interface's type variables.boolean
isArray()
Returntrue
if this type resolves to a Class that represents an array.boolean
isAssignableFrom(Class<?> other)
Determine whether thisResolvableType
is assignable from the specified other type.boolean
isAssignableFrom(ResolvableType other)
Determine whether thisResolvableType
is assignable from the specified other type.boolean
isInstance(Object obj)
Determine whether the given object is an instance of thisResolvableType
.Class<?>
resolve()
Resolve this type to aClass
, returningnull
if the type cannot be resolved.Class<?>
resolve(Class<?> fallback)
Resolve this type to aClass
, returning the specifiedfallback
if the type cannot be resolved.Class<?>
resolveGeneric(int... indexes)
Class<?>[]
resolveGenerics()
Class<?>[]
resolveGenerics(Class<?> fallback)
Class<?>
toClass()
Return this type as a resolvedClass
, falling back toObject
if no specific class can be resolved.String
toString()
Return a String representation of this type in its fully resolved form (including any generic parameters).
字段详细资料
NONE
public static final ResolvableType NONE
ResolvableType
returned when no value is available.NONE
is used in preference tonull
so that multiple method calls can be safely chained.
方法详细资料
getRawClass
@Nullable public Class<?> getRawClass()
Return the underlying JavaClass
being managed, if available; otherwisenull
.
getSource
public Object getSource()
Return the underlying source of the resolvable type. Will return aField
,MethodParameter
orType
depending on how theResolvableType
was constructed. With the exception of theNONE
constant, this method will never returnnull
. This method is primarily to provide access to additional type information or meta-data that alternative JVM languages may provide.
toClass
public Class<?> toClass()
Return this type as a resolvedClass
, falling back toObject
if no specific class can be resolved.- 返回:
- the resolved
Class
or theObject
fallback - 从以下版本开始:
- 5.1
- 另请参阅:
getRawClass()
,resolve(Class)
isInstance
public boolean isInstance(@Nullable Object obj)
Determine whether the given object is an instance of thisResolvableType
.- 参数:
obj
- the object to check- 从以下版本开始:
- 4.2
- 另请参阅:
isAssignableFrom(Class)
isAssignableFrom
public boolean isAssignableFrom(Class<?> other)
Determine whether thisResolvableType
is assignable from the specified other type.- 参数:
other
- the type to be checked against (as aClass
)- 从以下版本开始:
- 4.2
- 另请参阅:
isAssignableFrom(ResolvableType)
isAssignableFrom
public boolean isAssignableFrom(ResolvableType other)
Determine whether thisResolvableType
is assignable from the specified other type.Attempts to follow the same rules as the Java compiler, considering whether both the
resolved
Class
isassignable from
the given type as well as whether allgenerics
are assignable.- 参数:
other
- the type to be checked against (as aResolvableType
)- 返回:
true
if the specified other type can be assigned to thisResolvableType
;false
otherwise
isArray
public boolean isArray()
Returntrue
if this type resolves to a Class that represents an array.- 另请参阅:
getComponentType()
getComponentType
public ResolvableType getComponentType()
Return the ResolvableType representing the component type of the array orNONE
if this type does not represent an array.- 另请参阅:
isArray()
asCollection
public ResolvableType asCollection()
Convenience method to return this type as a resolvableCollection
type. ReturnsNONE
if this type does not implement or extendCollection
.
asMap
public ResolvableType asMap()
Convenience method to return this type as a resolvableMap
type. ReturnsNONE
if this type does not implement or extendMap
.- 另请参阅:
as(Class)
,asCollection()
as
public ResolvableType as(Class<?> type)
Return this type as aResolvableType
of the specified class. Searchessupertype
andinterface
hierarchies to find a match, returningNONE
if this type does not implement or extend the specified class.- 参数:
type
- the required type (typically narrowed)- 返回:
- a
ResolvableType
representing this object as the specified type, orNONE
if not resolvable as that type - 另请参阅:
asCollection()
,asMap()
,getSuperType()
,getInterfaces()
getSuperType
public ResolvableType getSuperType()
Return aResolvableType
representing the direct supertype of this type. If no supertype is available this method returnsNONE
.Note: The resulting
ResolvableType
instance may not beSerializable
.- 另请参阅:
getInterfaces()
getInterfaces
public ResolvableType[] getInterfaces()
Return aResolvableType
array representing the direct interfaces implemented by this type. If this type does not implement any interfaces an empty array is returned.Note: The resulting
ResolvableType
instances may not beSerializable
.- 另请参阅:
getSuperType()
hasGenerics
public boolean hasGenerics()
Returntrue
if this type contains generic parameters.
hasUnresolvableGenerics
public boolean hasUnresolvableGenerics()
Determine whether the underlying type has any unresolvable generics: either through an unresolvable type variable on the type itself or through implementing a generic interface in a raw fashion, i.e. without substituting that interface's type variables. The result will betrue
only in those two scenarios.
getNested
public ResolvableType getNested(int nestingLevel)
Return aResolvableType
for the specified nesting level. SeegetNested(int, Map)
for details.- 参数:
nestingLevel
- the nesting level- 返回:
- the
ResolvableType
type, or#NONE
getNested
public ResolvableType getNested(int nestingLevel, @Nullable Map<Integer,Integer> typeIndexesPerLevel)
Return aResolvableType
for the specified nesting level.The nesting level refers to the specific generic parameter that should be returned. A nesting level of 1 indicates this type; 2 indicates the first nested generic; 3 the second; and so on. For example, given
List<Set<Integer>>
level 1 refers to theList
, level 2 theSet
, and level 3 theInteger
.The
typeIndexesPerLevel
map can be used to reference a specific generic for the given level. For example, an index of 0 would refer to aMap
key; whereas, 1 would refer to the value. If the map does not contain a value for a specific level the last generic will be used (e.g. aMap
value).Nesting levels may also apply to array types; for example given
String[]
, a nesting level of 2 refers toString
.If a type does not
contain
generics thesupertype
hierarchy will be considered.- 参数:
nestingLevel
- the required nesting level, indexed from 1 for the current type, 2 for the first nested generic, 3 for the second and so ontypeIndexesPerLevel
- a map containing the generic index for a given nesting level (may benull
)- 返回:
- a
ResolvableType
for the nested level, orNONE
getGeneric
public ResolvableType getGeneric(@Nullable int... indexes)
Return aResolvableType
representing the generic parameter for the given indexes. Indexes are zero based; for example given the typeMap<Integer, List<String>>
,getGeneric(0)
will access theInteger
. Nested generics can be accessed by specifying multiple indexes; for examplegetGeneric(1, 0)
will access theString
from the nestedList
. For convenience, if no indexes are specified the first generic is returned.If no generic is available at the specified indexes
NONE
is returned.- 参数:
indexes
- the indexes that refer to the generic parameter (may be omitted to return the first generic)- 返回:
- a
ResolvableType
for the specified generic, orNONE
- 另请参阅:
hasGenerics()
,getGenerics()
,resolveGeneric(int...)
,resolveGenerics()
getGenerics
public ResolvableType[] getGenerics()
Return an array ofResolvableTypes
representing the generic parameters of this type. If no generics are available an empty array is returned. If you need to access a specific generic consider using thegetGeneric(int...)
method as it allows access to nested generics and protects againstIndexOutOfBoundsExceptions
.- 返回:
- an array of
ResolvableTypes
representing the generic parameters (nevernull
) - 另请参阅:
hasGenerics()
,getGeneric(int...)
,resolveGeneric(int...)
,resolveGenerics()
resolveGenerics
public Class<?>[] resolveGenerics()
- 返回:
- an array of resolved generic parameters (the resulting array will never be
null
, but it may containnull
elements}) - 另请参阅:
getGenerics()
,resolve()
resolveGenerics
public Class<?>[] resolveGenerics(Class<?> fallback)
Convenience method that willget
andresolve
generic parameters, using the specifiedfallback
if any type cannot be resolved.- 参数:
fallback
- the fallback class to use if resolution fails- 返回:
- an array of resolved generic parameters
- 另请参阅:
getGenerics()
,resolve()
resolveGeneric
@Nullable public Class<?> resolveGeneric(int... indexes)
- 参数:
indexes
- the indexes that refer to the generic parameter (may be omitted to return the first generic)- 返回:
- a resolved
Class
ornull
- 另请参阅:
getGeneric(int...)
,resolve()
resolve
@Nullable public Class<?> resolve()
Resolve this type to aClass
, returningnull
if the type cannot be resolved. This method will consider bounds ofTypeVariables
andWildcardTypes
if direct resolution fails; however, bounds ofObject.class
will be ignored.If this method returns a non-null
Class
andhasGenerics()
returnsfalse
, the given type effectively wraps a plainClass
, allowing for plainClass
processing if desirable.- 返回:
- the resolved
Class
, ornull
if not resolvable - 另请参阅:
resolve(Class)
,resolveGeneric(int...)
,resolveGenerics()
resolve
public Class<?> resolve(Class<?> fallback)
Resolve this type to aClass
, returning the specifiedfallback
if the type cannot be resolved. This method will consider bounds ofTypeVariables
andWildcardTypes
if direct resolution fails; however, bounds ofObject.class
will be ignored.- 参数:
fallback
- the fallback class to use if resolution fails- 返回:
- the resolved
Class
or thefallback
- 另请参阅:
resolve()
,resolveGeneric(int...)
,resolveGenerics()
toString
public String toString()
Return a String representation of this type in its fully resolved form (including any generic parameters).
forClass
public static ResolvableType forClass(@Nullable Class<?> clazz)
Return aResolvableType
for the specifiedClass
, using the full generic type information for assignability checks. For example:ResolvableType.forClass(MyArrayList.class)
.- 参数:
clazz
- the class to introspect (null
is semantically equivalent toObject.class
for typical use cases here)- 返回:
- a
ResolvableType
for the specified class - 另请参阅:
forClass(Class, Class)
,forClassWithGenerics(Class, Class...)
forRawClass
public static ResolvableType forRawClass(@Nullable Class<?> clazz)
Return aResolvableType
for the specifiedClass
, doing assignability checks against the raw class only (analogous toClass.isAssignableFrom(java.lang.Class<?>)
, which this serves as a wrapper for. For example:ResolvableType.forRawClass(List.class)
.- 参数:
clazz
- the class to introspect (null
is semantically equivalent toObject.class
for typical use cases here)- 返回:
- a
ResolvableType
for the specified class - 从以下版本开始:
- 4.2
- 另请参阅:
forClass(Class)
,getRawClass()
forClass
public static ResolvableType forClass(Class<?> baseType, Class<?> implementationClass)
Return aResolvableType
for the specified base type (interface or base class) with a given implementation class. For example:ResolvableType.forClass(List.class, MyArrayList.class)
.- 参数:
baseType
- the base type (must not benull
)implementationClass
- the implementation class- 返回:
- a
ResolvableType
for the specified base type backed by the given implementation class - 另请参阅:
forClass(Class)
,forClassWithGenerics(Class, Class...)
forClassWithGenerics
public static ResolvableType forClassWithGenerics(Class<?> clazz, Class<?>... generics)
Return aResolvableType
for the specifiedClass
with pre-declared generics.- 参数:
clazz
- the class (or interface) to introspectgenerics
- the generics of the class- 返回:
- a
ResolvableType
for the specific class and generics - 另请参阅:
forClassWithGenerics(Class, ResolvableType...)
forClassWithGenerics
public static ResolvableType forClassWithGenerics(Class<?> clazz, ResolvableType... generics)
Return aResolvableType
for the specifiedClass
with pre-declared generics.- 参数:
clazz
- the class (or interface) to introspectgenerics
- the generics of the class- 返回:
- a
ResolvableType
for the specific class and generics - 另请参阅:
forClassWithGenerics(Class, Class...)
forInstance
public static ResolvableType forInstance(Object instance)
Return aResolvableType
for the specified instance. The instance does not convey generic information but if it implementsResolvableTypeProvider
a more preciseResolvableType
can be used than the simple one based on theClass instance
.- 参数:
instance
- the instance- 返回:
- a
ResolvableType
for the specified instance - 从以下版本开始:
- 4.2
- 另请参阅:
ResolvableTypeProvider
forField
public static ResolvableType forField(Field field)
Return aResolvableType
for the specifiedField
.- 参数:
field
- the source field- 返回:
- a
ResolvableType
for the specified field - 另请参阅:
forField(Field, Class)
forField
public static ResolvableType forField(Field field, Class<?> implementationClass)
Return aResolvableType
for the specifiedField
with a given implementation.Use this variant when the class that declares the field includes generic parameter variables that are satisfied by the implementation class.
- 参数:
field
- the source fieldimplementationClass
- the implementation class- 返回:
- a
ResolvableType
for the specified field - 另请参阅:
forField(Field)
forField
public static ResolvableType forField(Field field, @Nullable ResolvableType implementationType)
Return aResolvableType
for the specifiedField
with a given implementation.Use this variant when the class that declares the field includes generic parameter variables that are satisfied by the implementation type.
- 参数:
field
- the source fieldimplementationType
- the implementation type- 返回:
- a
ResolvableType
for the specified field - 另请参阅:
forField(Field)
forField
public static ResolvableType forField(Field field, int nestingLevel)
Return aResolvableType
for the specifiedField
with the given nesting level.- 参数:
field
- the source fieldnestingLevel
- the nesting level (1 for the outer level; 2 for a nested generic type; etc)- 另请参阅:
forField(Field)
forField
public static ResolvableType forField(Field field, int nestingLevel, @Nullable Class<?> implementationClass)
Return aResolvableType
for the specifiedField
with a given implementation and the given nesting level.Use this variant when the class that declares the field includes generic parameter variables that are satisfied by the implementation class.
- 参数:
field
- the source fieldnestingLevel
- the nesting level (1 for the outer level; 2 for a nested generic type; etc)implementationClass
- the implementation class- 返回:
- a
ResolvableType
for the specified field - 另请参阅:
forField(Field)
forConstructorParameter
public static ResolvableType forConstructorParameter(Constructor<?> constructor, int parameterIndex)
Return aResolvableType
for the specifiedConstructor
parameter.- 参数:
constructor
- the source constructor (must not benull
)parameterIndex
- the parameter index- 返回:
- a
ResolvableType
for the specified constructor parameter - 另请参阅:
forConstructorParameter(Constructor, int, Class)
forConstructorParameter
public static ResolvableType forConstructorParameter(Constructor<?> constructor, int parameterIndex, Class<?> implementationClass)
Return aResolvableType
for the specifiedConstructor
parameter with a given implementation. Use this variant when the class that declares the constructor includes generic parameter variables that are satisfied by the implementation class.- 参数:
constructor
- the source constructor (must not benull
)parameterIndex
- the parameter indeximplementationClass
- the implementation class- 返回:
- a
ResolvableType
for the specified constructor parameter - 另请参阅:
forConstructorParameter(Constructor, int)
forMethodReturnType
public static ResolvableType forMethodReturnType(Method method)
Return aResolvableType
for the specifiedMethod
return type.- 参数:
method
- the source for the method return type- 返回:
- a
ResolvableType
for the specified method return - 另请参阅:
forMethodReturnType(Method, Class)
forMethodReturnType
public static ResolvableType forMethodReturnType(Method method, Class<?> implementationClass)
Return aResolvableType
for the specifiedMethod
return type. Use this variant when the class that declares the method includes generic parameter variables that are satisfied by the implementation class.- 参数:
method
- the source for the method return typeimplementationClass
- the implementation class- 返回:
- a
ResolvableType
for the specified method return - 另请参阅:
forMethodReturnType(Method)
forMethodParameter
public static ResolvableType forMethodParameter(Method method, int parameterIndex)
Return aResolvableType
for the specifiedMethod
parameter.- 参数:
method
- the source method (must not benull
)parameterIndex
- the parameter index- 返回:
- a
ResolvableType
for the specified method parameter - 另请参阅:
forMethodParameter(Method, int, Class)
,forMethodParameter(MethodParameter)
forMethodParameter
public static ResolvableType forMethodParameter(Method method, int parameterIndex, Class<?> implementationClass)
Return aResolvableType
for the specifiedMethod
parameter with a given implementation. Use this variant when the class that declares the method includes generic parameter variables that are satisfied by the implementation class.- 参数:
method
- the source method (must not benull
)parameterIndex
- the parameter indeximplementationClass
- the implementation class- 返回:
- a
ResolvableType
for the specified method parameter - 另请参阅:
forMethodParameter(Method, int, Class)
,forMethodParameter(MethodParameter)
forMethodParameter
public static ResolvableType forMethodParameter(MethodParameter methodParameter)
Return aResolvableType
for the specifiedMethodParameter
.- 参数:
methodParameter
- the source method parameter (must not benull
)- 返回:
- a
ResolvableType
for the specified method parameter - 另请参阅:
forMethodParameter(Method, int)
forMethodParameter
public static ResolvableType forMethodParameter(MethodParameter methodParameter, @Nullable ResolvableType implementationType)
Return aResolvableType
for the specifiedMethodParameter
with a given implementation type. Use this variant when the class that declares the method includes generic parameter variables that are satisfied by the implementation type.- 参数:
methodParameter
- the source method parameter (must not benull
)implementationType
- the implementation type- 返回:
- a
ResolvableType
for the specified method parameter - 另请参阅:
forMethodParameter(MethodParameter)
forMethodParameter
public static ResolvableType forMethodParameter(MethodParameter methodParameter, @Nullable Type targetType)
Return aResolvableType
for the specifiedMethodParameter
, overriding the target type to resolve with a specific given type.- 参数:
methodParameter
- the source method parameter (must not benull
)targetType
- the type to resolve (a part of the method parameter's type)- 返回:
- a
ResolvableType
for the specified method parameter - 另请参阅:
forMethodParameter(Method, int)
forArrayComponent
public static ResolvableType forArrayComponent(ResolvableType componentType)
Return aResolvableType
as a array of the specifiedcomponentType
.- 参数:
componentType
- the component type- 返回:
- a
ResolvableType
as an array of the specified component type
forType
public static ResolvableType forType(@Nullable Type type)
Return aResolvableType
for the specifiedType
.Note: The resulting
ResolvableType
instance may not beSerializable
.- 参数:
type
- the source type (potentiallynull
)- 返回:
- a
ResolvableType
for the specifiedType
- 另请参阅:
forType(Type, ResolvableType)
forType
public static ResolvableType forType(@Nullable Type type, @Nullable ResolvableType owner)
Return aResolvableType
for the specifiedType
backed by the given owner type.Note: The resulting
ResolvableType
instance may not beSerializable
.- 参数:
type
- the source type ornull
owner
- the owner type used to resolve variables- 返回:
- a
ResolvableType
for the specifiedType
and owner - 另请参阅:
forType(Type)
forType
public static ResolvableType forType(ParameterizedTypeReference<?> typeReference)
Return aResolvableType
for the specifiedParameterizedTypeReference
.Note: The resulting
ResolvableType
instance may not beSerializable
.- 参数:
typeReference
- the reference to obtain the source type from- 返回:
- a
ResolvableType
for the specifiedParameterizedTypeReference
- 从以下版本开始:
- 4.3.12
- 另请参阅:
forType(Type)
clearCache
public static void clearCache()
Clear the internalResolvableType
/SerializableTypeWrapper
cache.- 从以下版本开始:
- 4.2