Top Description Constructors Methods
com.fasterxml.jackson.core.type

public abstract Class ResolvedType

extends Object
Class Inheritance

Type abstraction that represents Java type that has been resolved (i.e. has all generic information, if any, resolved to concrete types). Note that this is an intermediate type, and all concrete instances MUST be of type JavaType from "databind" bundle -- this abstraction is only needed so that types can be passed through com.fasterxml.jackson.core.JsonParser#readValueAs methods.
Since
2.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract ResolvedType

Returns:

Contained type at index, or null if no such type exists (no exception thrown)
containedType
(int
Index of contained type to return
index
)

Method for accessing definitions of contained ("child") types.

public abstract int

Returns:

Number of contained types that may be accessed
containedTypeCount
()

Method for checking how many contained types this type has.

public abstract String

Returns:

Contained type at index, or null if no such type exists (no exception thrown)
containedTypeName
(int
Index of contained type to return
index
)

Method for accessing name of type variable in indicated position.

public abstract ResolvedType

Returns:

Content type of this type, if any; null if none
getContentType
()

Method for accessing content type of this type, if type has such a thing: simple types do not, structured types do (like arrays, Collections and Maps)

public abstract ResolvedType

Returns:

Key type of this type, if any; null if none
getKeyType
()

Method for accessing key type for this type, assuming type has such a concept (only Map types do)

public Class<?>

Returns:

Type-erased class of something not usable at this point
getParameterSource
()
Deprecated Since 2.7: does not have meaning as parameters depend on type resolved.

public abstract Class<?>

Returns:

Type-erased Class of resolved type
getRawClass
()

public abstract ResolvedType

Returns:

Referenced type, if any; null if not.
getReferencedType
()

Method for accessing type of value that instances of this type references, if any.

public abstract boolean

Returns:

True if this type has generic type parameters, false if not
hasGenericTypes
()

Method that can be used to find out if the type directly declares generic parameters (for its direct super-class and/or super-interfaces).

public abstract boolean
public abstract boolean
public abstract boolean
public abstract boolean
public abstract boolean
public abstract boolean
public abstract boolean
public abstract boolean
public abstract boolean
public abstract boolean
public abstract boolean
public boolean

Returns:

True if this is a "referential" type, false if not
isReferenceType
()

Whether this type is a referential type, meaning that values are basically pointers to "real" values (or null) and not regular values themselves.

public abstract boolean
public abstract String

Returns:

String representation of the fully resolved type
toCanonical
()

Method that can be used to serialize type into form from which it can be fully deserialized from at a later point (using TypeFactory from mapper package).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ResolvedTypeback to summary
public ResolvedType()

Method Detail

containedTypeback to summary
public abstract ResolvedType containedType(int index)

Method for accessing definitions of contained ("child") types.

Parameters
index:int

Index of contained type to return

Returns:ResolvedType

Contained type at index, or null if no such type exists (no exception thrown)

containedTypeCountback to summary
public abstract int containedTypeCount()

Method for checking how many contained types this type has. Contained types are usually generic types, so that generic Maps have 2 contained types.

Returns:int

Number of contained types that may be accessed

containedTypeNameback to summary
public abstract String containedTypeName(int index)

Method for accessing name of type variable in indicated position. If no name is bound, will use placeholders (derived from 0-based index); if no type variable or argument exists with given index, null is returned.

Parameters
index:int

Index of contained type to return

Returns:String

Contained type at index, or null if no such type exists (no exception thrown)

getContentTypeback to summary
public abstract ResolvedType getContentType()

Method for accessing content type of this type, if type has such a thing: simple types do not, structured types do (like arrays, Collections and Maps)

Returns:ResolvedType

Content type of this type, if any; null if none

getKeyTypeback to summary
public abstract ResolvedType getKeyType()

Method for accessing key type for this type, assuming type has such a concept (only Map types do)

Returns:ResolvedType

Key type of this type, if any; null if none

getParameterSourceback to summary
public Class<?> getParameterSource()

Deprecated

Since 2.7: does not have meaning as parameters depend on type resolved.

Returns:Class<?>

Type-erased class of something not usable at this point

Annotations
@Deprecated
getRawClassback to summary
public abstract Class<?> getRawClass()
Returns:Class<?>

Type-erased Class of resolved type

getReferencedTypeback to summary
public abstract ResolvedType getReferencedType()

Method for accessing type of value that instances of this type references, if any.

Returns:ResolvedType

Referenced type, if any; null if not.

Since
2.6
hasGenericTypesback to summary
public abstract boolean hasGenericTypes()

Method that can be used to find out if the type directly declares generic parameters (for its direct super-class and/or super-interfaces).

Returns:boolean

True if this type has generic type parameters, false if not

hasRawClassback to summary
public abstract boolean hasRawClass(Class<?> clz)
isAbstractback to summary
public abstract boolean isAbstract()
isArrayTypeback to summary
public abstract boolean isArrayType()
isCollectionLikeTypeback to summary
public abstract boolean isCollectionLikeType()
isConcreteback to summary
public abstract boolean isConcrete()
isContainerTypeback to summary
public abstract boolean isContainerType()
isEnumTypeback to summary
public abstract boolean isEnumType()
isFinalback to summary
public abstract boolean isFinal()
isInterfaceback to summary
public abstract boolean isInterface()
isMapLikeTypeback to summary
public abstract boolean isMapLikeType()
isPrimitiveback to summary
public abstract boolean isPrimitive()
isReferenceTypeback to summary
public boolean isReferenceType()

Whether this type is a referential type, meaning that values are basically pointers to "real" values (or null) and not regular values themselves. Typical examples include things like java.util.concurrent.atomic.AtomicReference, and various Optional types (in JDK8, Guava).

Returns:boolean

True if this is a "referential" type, false if not

Since
2.6
isThrowableback to summary
public abstract boolean isThrowable()
toCanonicalback to summary
public abstract String toCanonical()

Method that can be used to serialize type into form from which it can be fully deserialized from at a later point (using TypeFactory from mapper package). For simple types this is same as calling Class#getName, but for structured types it may additionally contain type information about contents.

Returns:String

String representation of the fully resolved type