Class TypeBase
java.lang.Object
com.fasterxml.jackson.core.type.ResolvedType
com.fasterxml.jackson.databind.JavaType
com.fasterxml.jackson.databind.type.TypeBase
- All Implemented Interfaces:
JsonSerializable,Serializable,Type
- Direct Known Subclasses:
ArrayType,CollectionLikeType,MapLikeType,PlaceholderForType,ResolvedRecursiveType,SimpleType
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.fasterxml.jackson.databind.JsonSerializable
JsonSerializable.Base -
Method Summary
Modifier and TypeMethodDescriptioncontainedType(int index) Method for accessing definitions of contained ("child") types.intMethod for checking how many contained types this type has.containedTypeName(int index) Deprecated.final JavaTypefindSuperType(Class<?> rawTarget) 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.JavaType[]findTypeParameters(Class<?> expType) Method that may be used to find paramaterization this type has for given type-erased generic target type.abstract StringBuilderMethod 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.abstract StringBuilderAccessor for finding fully resolved interfaces this type implements, if any; empty array if none.Accessor for finding fully resolved parent class of this type, if it has one; null if not.voidserialize(JsonGenerator gen, SerializerProvider provider) Serialization method called when no additional type information is to be included in serialization.voidserializeWithType(JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) Serialization method called when additional type information is expected to be included in serialization, for deserialization to use.Method that can be used to serialize type into form from which it can be fully deserialized from at a later point (usingTypeFactoryfrom mapper package).Methods inherited from class com.fasterxml.jackson.databind.JavaType
containedTypeOrUnknown, equals, forcedNarrowBy, getContentType, getContentTypeHandler, getContentValueHandler, getErasedSignature, getGenericSignature, getKeyType, getParameterSource, getRawClass, getReferencedType, getTypeHandler, getValueHandler, hasContentType, hasGenericTypes, hasHandlers, hashCode, hasRawClass, hasValueHandler, isAbstract, isArrayType, isCollectionLikeType, isConcrete, isContainerType, isEnumImplType, isEnumType, isFinal, isInterface, isIterationType, isJavaLangObject, isMapLikeType, isPrimitive, isRecordType, isThrowable, isTypeOrSubTypeOf, isTypeOrSuperTypeOf, refine, toString, useStaticType, withContentType, withContentTypeHandler, withContentValueHandler, withHandlersFrom, withStaticTyping, withTypeHandler, withValueHandlerMethods inherited from class com.fasterxml.jackson.core.type.ResolvedType
isReferenceTypeMethods inherited from interface java.lang.reflect.Type
getTypeName
-
Method Details
-
toCanonical
Description copied from class:ResolvedTypeMethod that can be used to serialize type into form from which it can be fully deserialized from at a later point (usingTypeFactoryfrom mapper package). For simple types this is same as callingClass.getName(), but for structured types it may additionally contain type information about contents.- Specified by:
toCanonicalin classResolvedType- Returns:
- String representation of the fully resolved type
-
getGenericSignature
- Specified by:
getGenericSignaturein classJavaType- Parameters:
sb- StringBuilder to append signature to- Returns:
- StringBuilder that was passed in; returned to allow call chaining
-
getErasedSignature
Description copied from class:JavaTypeMethod 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.- Specified by:
getErasedSignaturein classJavaType- Parameters:
sb- StringBuilder to append signature to- Returns:
- StringBuilder that was passed in; returned to allow call chaining
-
getBindings
- Specified by:
getBindingsin classJavaType
-
containedTypeCount
public int containedTypeCount()Description copied from class:ResolvedTypeMethod for checking how many contained types this type has. Contained types are usually generic types, so that generic Maps have 2 contained types.- Specified by:
containedTypeCountin classJavaType- Returns:
- Number of contained types that may be accessed
-
containedType
Description copied from class:ResolvedTypeMethod for accessing definitions of contained ("child") types.- Specified by:
containedTypein classJavaType- Parameters:
index- Index of contained type to return- Returns:
- Contained type at index, or null if no such type exists (no exception thrown)
-
containedTypeName
Deprecated.Description copied from class:ResolvedTypeMethod 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.- Specified by:
containedTypeNamein classJavaType- Parameters:
index- Index of contained type to return- Returns:
- Contained type at index, or null if no such type exists (no exception thrown)
-
getSuperClass
Description copied from class:JavaTypeAccessor for finding fully resolved parent class of this type, if it has one; null if not.- Specified by:
getSuperClassin classJavaType
-
getInterfaces
Description copied from class:JavaTypeAccessor for finding fully resolved interfaces this type implements, if any; empty array if none.- Specified by:
getInterfacesin classJavaType
-
findSuperType
Description copied from class:JavaTypeMethod 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.- Specified by:
findSuperTypein classJavaType
-
findTypeParameters
Description copied from class:JavaTypeMethod that may be used to find paramaterization this type has for given type-erased generic target type.- Specified by:
findTypeParametersin classJavaType
-
serializeWithType
public void serializeWithType(JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException Description copied from interface:JsonSerializableSerialization 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(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)followed by serialization of contents, followed by a call toTypeSerializer.writeTypeSuffix(com.fasterxml.jackson.core.JsonGenerator, com.fasterxml.jackson.core.type.WritableTypeId)). 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.
- Specified by:
serializeWithTypein interfaceJsonSerializable- Throws:
IOException
-
serialize
Description copied from interface:JsonSerializableSerialization method called when no additional type information is to be included in serialization.- Specified by:
serializein interfaceJsonSerializable- Throws:
IOException
-