Top Description Fields Constructors Methods
com.fasterxml.jackson.jr.type

public Class TypeResolver

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Imports
java.io.Serializable, java.lang.reflect.*, java.util.*, com.fasterxml.jackson.jr.ob.impl.ClassKey

Object that is used for resolving generic type information of a class so that it is accessible using simple API. Resolved types are also starting point for accessing resolved (generics aware) return and argument types of class members (methods, fields, constructors).

Note that resolver instances are stateful in that resolvers cache resolved types for efficiency. Since this is internal state and not directly visible to callers, access to state is fully synchronized so that access from multiple threads is safe.

Field Summary

Modifier and TypeField and Description
protected final transient Map<ClassKey, ResolvedType>
private static final HashMap<ClassKey, ResolvedType>
private static final ResolvedType[]
private static final long
private static final ResolvedType

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private ResolvedType
_constructType(ClassStack context, Class<?> rawType, TypeBindings typeBindings)

private ResolvedType
_fromAny(ClassStack context, Type mainType, TypeBindings typeBindings)

private ResolvedType
_fromClass(ClassStack context, Class<?> rawType, TypeBindings typeBindings)

private ResolvedType
_fromParamType(ClassStack context, ParameterizedType ptype, TypeBindings parentBindings)

private ResolvedType
_fromVariable(ClassStack context, TypeVariable<?> variable, TypeBindings typeBindings)

private ResolvedType
_resolveSuperClass(ClassStack context, Class<?> rawType, TypeBindings typeBindings)

private ResolvedType[]
_resolveSuperInterfaces(ClassStack context, Class<?> rawType, TypeBindings typeBindings)

protected Object
public ResolvedType
resolve(TypeBindings typeBindings, Type jdkType)

Factory method for resolving specified Java java.lang.reflect.Type, given TypeBindings needed to resolve any type variables.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_cacheback to summary
protected final transient Map<ClassKey, ResolvedType> _cache
_primitivesback to summary
private static final HashMap<ClassKey, ResolvedType> _primitives
NO_TYPESback to summary
private static final ResolvedType[] NO_TYPES
serialVersionUIDback to summary
private static final long serialVersionUID
TYPE_OBJECTback to summary
private static final ResolvedType TYPE_OBJECT

Constructor Detail

TypeResolverback to summary
public TypeResolver()

Method Detail

_constructTypeback to summary
private ResolvedType _constructType(ClassStack context, Class<?> rawType, TypeBindings typeBindings)
_fromAnyback to summary
private ResolvedType _fromAny(ClassStack context, Type mainType, TypeBindings typeBindings)
_fromClassback to summary
private ResolvedType _fromClass(ClassStack context, Class<?> rawType, TypeBindings typeBindings)
_fromParamTypeback to summary
private ResolvedType _fromParamType(ClassStack context, ParameterizedType ptype, TypeBindings parentBindings)
_fromVariableback to summary
private ResolvedType _fromVariable(ClassStack context, TypeVariable<?> variable, TypeBindings typeBindings)
_resolveSuperClassback to summary
private ResolvedType _resolveSuperClass(ClassStack context, Class<?> rawType, TypeBindings typeBindings)
_resolveSuperInterfacesback to summary
private ResolvedType[] _resolveSuperInterfaces(ClassStack context, Class<?> rawType, TypeBindings typeBindings)
readResolveback to summary
protected Object readResolve()
resolveback to summary
public ResolvedType resolve(TypeBindings typeBindings, Type jdkType)

Factory method for resolving specified Java java.lang.reflect.Type, given TypeBindings needed to resolve any type variables.

Use of this method is discouraged (use if and only if you really know what you are doing!); but if used, type bindings passed should come from ResolvedType instance of declaring class (or interface).