Top Fields Constructors Methods
tools.jackson.databind.type

public abstract Class TypeBase

extends JavaType
implements JacksonSerializable
Class Inheritance
All Implemented Interfaces
tools.jackson.databind.JacksonSerializable
Known Direct Subclasses
tools.jackson.databind.type.ArrayType, tools.jackson.databind.type.CollectionLikeType, tools.jackson.databind.type.IdentityEqualityType, tools.jackson.databind.type.MapLikeType, tools.jackson.databind.type.SimpleType
Imports
java.lang.reflect.TypeVariable, java.util.*, tools.jackson.core.JacksonException, .JsonGenerator, .JsonToken, tools.jackson.core.type.WritableTypeId, tools.jackson.databind.*, tools.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 tools.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 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)

Implements abstract tools.jackson.databind.JavaType.containedType.

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

public int
containedTypeCount()

Implements abstract tools.jackson.databind.JavaType.containedTypeCount.

Method for checking how many contained types this type has.

public final JavaType
findSuperType(Class<?> rawTarget)

Implements abstract tools.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 tools.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 sb)

Implements abstract tools.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
public List<JavaType>
getInterfaces()

Implements abstract tools.jackson.databind.JavaType.getInterfaces.

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

public JavaType
getSuperClass()

Implements abstract tools.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, SerializationContext provider)

Implements tools.jackson.databind.JacksonSerializable.serialize.

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

public void
serializeWithType(JsonGenerator g, SerializationContext ctxt, TypeSerializer typeSer)

Implements tools.jackson.databind.JacksonSerializable.serializeWithType.

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

public String
toCanonical()

Implements abstract tools.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 tools.jackson.databind.JavaType:
containedTypeOrUnknownequalsgetContentTypegetContentTypeHandlergetContentValueHandlergetErasedSignaturegetGenericSignaturegetKeyTypegetRawClassgetReferencedTypegetTypeHandlergetValueHandlerhasContentTypehasGenericTypeshasHandlershashCodehasRawClasshasValueHandlerisAbstractisArrayTypeisCollectionLikeTypeisConcreteisContainerTypeisEnumImplTypeisEnumTypeisFinalisInterfaceisIterationTypeisJavaLangObjectisMapLikeTypeisPrimitiveisRecordTypeisThrowableisTypeOrSubTypeOfisTypeOrSuperTypeOfrefinetoStringuseStaticTypewithContentTypewithContentTypeHandlerwithContentValueHandlerwithHandlersFromwithStaticTypingwithTypeHandlerwithValueHandler

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).

_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 tools.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.

Method Detail

_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 tools.jackson.databind.JavaType.containedType.

Doc from tools.jackson.core.type.ResolvedType.containedType.

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

Annotations
@Override
containedTypeCountback to summary
public int containedTypeCount()

Implements abstract tools.jackson.databind.JavaType.containedTypeCount.

Doc from tools.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.

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

Implements abstract tools.jackson.databind.JavaType.findSuperType.

Doc from tools.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 tools.jackson.databind.JavaType.findTypeParameters.

Doc from tools.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 tools.jackson.databind.JavaType.getBindings.

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

Implements abstract tools.jackson.databind.JavaType.getErasedSignature.

Doc from tools.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.

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

Implements abstract tools.jackson.databind.JavaType.getGenericSignature.

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

Implements abstract tools.jackson.databind.JavaType.getInterfaces.

Doc from tools.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 tools.jackson.databind.JavaType.getSuperClass.

Doc from tools.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, SerializationContext provider) throws JacksonException

Implements tools.jackson.databind.JacksonSerializable.serialize.

Doc from tools.jackson.databind.JacksonSerializable.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, SerializationContext ctxt, TypeSerializer typeSer) throws JacksonException

Implements tools.jackson.databind.JacksonSerializable.serializeWithType.

Doc from tools.jackson.databind.JacksonSerializable.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 tools.jackson.core.type.ResolvedType.toCanonical.

Doc from tools.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.

Annotations
@Override