Top Fields Constructors Methods
com.fasterxml.jackson.databind.type

public abstract Class TypeBase

extends JavaType
implements JsonSerializable
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.databind.JsonSerializable
Known Direct Subclasses
com.fasterxml.jackson.databind.type.ArrayType, com.fasterxml.jackson.databind.type.CollectionLikeType, com.fasterxml.jackson.databind.type.IdentityEqualityType, com.fasterxml.jackson.databind.type.MapLikeType, com.fasterxml.jackson.databind.type.SimpleType
Imports
java.io.IOException, java.lang.reflect.TypeVariable, java.util.*, com.fasterxml.jackson.core.JsonGenerator, .JsonToken, com.fasterxml.jackson.core.type.WritableTypeId, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.jsontype.TypeSerializer

Field Summary

Modifier and TypeField and Description
protected final TypeBindings
_bindings

Bindings in effect for this type instance; possibly empty.

pack-priv transient volatile String
_canonicalName

Lazily initialized external representation of the type

protected final JavaType
protected final JavaType[]
private static final TypeBindings
private static final JavaType[]
private static final long
Inherited from com.fasterxml.jackson.databind.JavaType:
_asStatic_class_hash_typeHandler_valueHandler

Constructor Summary

AccessConstructor and Description
protected
TypeBase(Class<?> raw, TypeBindings bindings, JavaType superClass, JavaType[] superInts, int hash, Object valueHandler, Object typeHandler, boolean asStatic)

Main constructor to use by extending classes.

protected
TypeBase(TypeBase base)

Copy-constructor used when refining/upgrading type instances.

Method Summary

Modifier and TypeMethod and Description
protected static JavaType
_bogusSuperClass(Class<?> cls)

Internal helper method used to figure out nominal super-class for deprecated factory methods / constructors, where we are not given properly resolved supertype hierarchy.

protected static StringBuilder
_classSignature(Class<?> cls, StringBuilder sb, boolean
Whether to add trailing semicolon for non-primitive (reference) types or not
trailingSemicolon
)

protected boolean
protected String
public JavaType
containedType(int
Index of contained type to return
index
)

Implements abstract com.fasterxml.jackson.databind.JavaType.containedType.

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

Implements abstract com.fasterxml.jackson.databind.JavaType.containedTypeCount.

Method for checking how many contained types this type has.
public String
containedTypeName(int
Index of contained type to return
index
)

Implements abstract com.fasterxml.jackson.databind.JavaType.containedTypeName.

Deprecated
Method for accessing name of type variable in indicated position.
public final JavaType
findSuperType(Class<?> rawTarget)

Implements abstract com.fasterxml.jackson.databind.JavaType.findSuperType.

Method that may be called to find representation of given type within type hierarchy of this type: either this type (if this type has given erased type), one of its supertypes that has the erased types, or null if target is neither this type or any of its supertypes.
public JavaType[]
findTypeParameters(Class<?> expType)

Implements abstract com.fasterxml.jackson.databind.JavaType.findTypeParameters.

Method that may be used to find paramaterization this type has for given type-erased generic target type.
public TypeBindings
public abstract StringBuilder
getErasedSignature(StringBuilder
StringBuilder to append signature to
sb
)

Implements abstract com.fasterxml.jackson.databind.JavaType.getErasedSignature.

Method for accessing signature without generic type information, in form compatible with all versions of JVM, and specifically used for type descriptions when generating byte code.
public abstract StringBuilder
getGenericSignature(StringBuilder
StringBuilder to append signature to
sb
)

Implements abstract com.fasterxml.jackson.databind.JavaType.getGenericSignature.

public List<JavaType>
getInterfaces()

Implements abstract com.fasterxml.jackson.databind.JavaType.getInterfaces.

Accessor for finding fully resolved interfaces this type implements, if any; empty array if none.
public JavaType
getSuperClass()

Implements abstract com.fasterxml.jackson.databind.JavaType.getSuperClass.

Accessor for finding fully resolved parent class of this type, if it has one; null if not.
public void
serialize(JsonGenerator gen, SerializerProvider provider)

Implements com.fasterxml.jackson.databind.JsonSerializable.serialize.

Serialization method called when no additional type information is to be included in serialization.
public void
serializeWithType(JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer)

Implements com.fasterxml.jackson.databind.JsonSerializable.serializeWithType.

Serialization method called when additional type information is expected to be included in serialization, for deserialization to use.
public String
toCanonical()

Implements abstract com.fasterxml.jackson.core.type.ResolvedType.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 com.fasterxml.jackson.databind.JavaType:
_narrowcontainedTypeOrUnknownequalsforcedNarrowBygetContentTypegetContentTypeHandlergetContentValueHandlergetErasedSignaturegetGenericSignaturegetKeyTypegetParameterSourcegetRawClassgetReferencedTypegetTypeHandlergetValueHandlerhasContentTypehasGenericTypeshasHandlershashCodehasRawClasshasValueHandlerisAbstractisArrayTypeisCollectionLikeTypeisConcreteisContainerTypeisEnumImplTypeisEnumTypeisFinalisInterfaceisIterationTypeisJavaLangObjectisMapLikeTypeisPrimitiveisRecordTypeisThrowableisTypeOrSubTypeOfisTypeOrSuperTypeOfrefinetoStringuseStaticTypewithContentTypewithContentTypeHandlerwithContentValueHandlerwithHandlersFromwithStaticTypingwithTypeHandlerwithValueHandler

Field Detail

_bindingsback to summary
protected final TypeBindings _bindings

Bindings in effect for this type instance; possibly empty. Needed when resolving types declared in members of this type (if any).

Since
2.7
_canonicalNameback to summary
pack-priv transient volatile String _canonicalName

Lazily initialized external representation of the type

_superClassback to summary
protected final JavaType _superClass
_superInterfacesback to summary
protected final JavaType[] _superInterfaces
NO_BINDINGSback to summary
private static final TypeBindings NO_BINDINGS
NO_TYPESback to summary
private static final JavaType[] NO_TYPES
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.fasterxml.jackson.databind.JavaType.serialVersionUID.

Constructor Detail

TypeBaseback to summary
protected TypeBase(Class<?> raw, TypeBindings bindings, JavaType superClass, JavaType[] superInts, int hash, Object valueHandler, Object typeHandler, boolean asStatic)

Main constructor to use by extending classes.

TypeBaseback to summary
protected TypeBase(TypeBase base)

Copy-constructor used when refining/upgrading type instances.

Since
2.7

Method Detail

_bogusSuperClassback to summary
protected static JavaType _bogusSuperClass(Class<?> cls)

Internal helper method used to figure out nominal super-class for deprecated factory methods / constructors, where we are not given properly resolved supertype hierarchy. Will basically give `JavaType` for `java.lang.Object` for classes other than `java.lafgn.Object`; null for others.

Since
2.7
_classSignatureback to summary
protected static StringBuilder _classSignature(Class<?> cls, StringBuilder sb, boolean trailingSemicolon)
Parameters
trailingSemicolon:boolean

Whether to add trailing semicolon for non-primitive (reference) types or not

_hasNTypeParametersback to summary
protected boolean _hasNTypeParameters(int count)
buildCanonicalNameback to summary
protected String buildCanonicalName()
containedTypeback to summary
public JavaType containedType(int index)

Implements abstract com.fasterxml.jackson.databind.JavaType.containedType.

Doc from com.fasterxml.jackson.core.type.ResolvedType.containedType.

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

Parameters
index:int

Index of contained type to return

Returns:JavaType

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

Annotations
@Override
containedTypeCountback to summary
public int containedTypeCount()

Implements abstract com.fasterxml.jackson.databind.JavaType.containedTypeCount.

Doc from com.fasterxml.jackson.core.type.ResolvedType.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

Annotations
@Override
containedTypeNameback to summary
public String containedTypeName(int index)

Implements abstract com.fasterxml.jackson.databind.JavaType.containedTypeName.

Doc from com.fasterxml.jackson.core.type.ResolvedType.containedTypeName.

Deprecated

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)

Annotations
@Override
@Deprecated
findSuperTypeback to summary
public final JavaType findSuperType(Class<?> rawTarget)

Implements abstract com.fasterxml.jackson.databind.JavaType.findSuperType.

Doc from com.fasterxml.jackson.databind.JavaType.findSuperType.

Method that may be called to find representation of given type within type hierarchy of this type: either this type (if this type has given erased type), one of its supertypes that has the erased types, or null if target is neither this type or any of its supertypes.

Annotations
@Override
findTypeParametersback to summary
public JavaType[] findTypeParameters(Class<?> expType)

Implements abstract com.fasterxml.jackson.databind.JavaType.findTypeParameters.

Doc from com.fasterxml.jackson.databind.JavaType.findTypeParameters.

Method that may be used to find paramaterization this type has for given type-erased generic target type.

Annotations
@Override
getBindingsback to summary
public TypeBindings getBindings()

Implements abstract com.fasterxml.jackson.databind.JavaType.getBindings.

Annotations
@Override
getErasedSignatureback to summary
public abstract StringBuilder getErasedSignature(StringBuilder sb)

Implements abstract com.fasterxml.jackson.databind.JavaType.getErasedSignature.

Doc from com.fasterxml.jackson.databind.JavaType.getErasedSignature.

Method for accessing signature without generic type information, in form compatible with all versions of JVM, and specifically used for type descriptions when generating byte code.

Parameters
sb:StringBuilder

StringBuilder to append signature to

Returns:StringBuilder

StringBuilder that was passed in; returned to allow call chaining

Annotations
@Override
getGenericSignatureback to summary
public abstract StringBuilder getGenericSignature(StringBuilder sb)

Implements abstract com.fasterxml.jackson.databind.JavaType.getGenericSignature.

Parameters
sb:StringBuilder

Doc from com.fasterxml.jackson.databind.JavaType.getGenericSignature.

StringBuilder to append signature to

Returns:StringBuilder

Doc from com.fasterxml.jackson.databind.JavaType.getGenericSignature.

StringBuilder that was passed in; returned to allow call chaining

Annotations
@Override
getInterfacesback to summary
public List<JavaType> getInterfaces()

Implements abstract com.fasterxml.jackson.databind.JavaType.getInterfaces.

Doc from com.fasterxml.jackson.databind.JavaType.getInterfaces.

Accessor for finding fully resolved interfaces this type implements, if any; empty array if none.

Annotations
@Override
getSuperClassback to summary
public JavaType getSuperClass()

Implements abstract com.fasterxml.jackson.databind.JavaType.getSuperClass.

Doc from com.fasterxml.jackson.databind.JavaType.getSuperClass.

Accessor for finding fully resolved parent class of this type, if it has one; null if not.

Annotations
@Override
serializeback to summary
public void serialize(JsonGenerator gen, SerializerProvider provider) throws IOException

Implements com.fasterxml.jackson.databind.JsonSerializable.serialize.

Doc from com.fasterxml.jackson.databind.JsonSerializable.serialize.

Serialization method called when no additional type information is to be included in serialization.

Annotations
@Override
serializeWithTypeback to summary
public void serializeWithType(JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException

Implements com.fasterxml.jackson.databind.JsonSerializable.serializeWithType.

Doc from com.fasterxml.jackson.databind.JsonSerializable.serializeWithType.

Serialization method called when additional type information is expected to be included in serialization, for deserialization to use.

Usually implementation consists of a call to TypeSerializer#writeTypePrefix followed by serialization of contents, followed by a call to TypeSerializer#writeTypeSuffix). Details of the type id argument to pass depend on shape of JSON Object used (Array, Object or scalar like String/Number/Boolean).

Note that some types (most notably, "natural" types: String, Integer, Double and Boolean) never include type information.

Annotations
@Override
toCanonicalback to summary
public String toCanonical()

Implements abstract com.fasterxml.jackson.core.type.ResolvedType.toCanonical.

Doc from com.fasterxml.jackson.core.type.ResolvedType.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

Annotations
@Override