public abstract class TypeBase extends JavaType implements JsonSerializable
JsonSerializable.Base| Modifier and Type | Field and Description |
|---|---|
protected TypeBindings |
_bindings
Bindings in effect for this type instance; possibly empty.
|
protected JavaType |
_superClass |
protected JavaType[] |
_superInterfaces |
_asStatic, _class, _hash, _typeHandler, _valueHandler| Modifier | Constructor 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.
|
| Modifier and Type | Method 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 trailingSemicolon) |
protected String |
buildCanonicalName() |
JavaType |
containedType(int index) |
int |
containedTypeCount() |
String |
containedTypeName(int index)
Deprecated.
|
JavaType |
findSuperType(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.
|
TypeBindings |
getBindings() |
abstract StringBuilder |
getErasedSignature(StringBuilder sb)
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.
|
abstract StringBuilder |
getGenericSignature(StringBuilder sb) |
List<JavaType> |
getInterfaces()
Accessor for finding fully resolved interfaces this type implements,
if any; empty array if none.
|
JavaType |
getSuperClass()
Accessor for finding fully resolved parent class of this type,
if it has one; null if not.
|
void |
serialize(JsonGenerator gen,
SerializerProvider provider)
Serialization method called when no additional type information is
to be included in serialization.
|
void |
serializeWithType(JsonGenerator g,
SerializerProvider provider,
TypeSerializer typeSer)
Serialization method called when additional type information is
expected to be included in serialization, for deserialization to use.
|
String |
toCanonical() |
_narrow, 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, isJavaLangObject, isMapLikeType, isPrimitive, isThrowable, isTypeOrSubTypeOf, isTypeOrSuperTypeOf, refine, toString, useStaticType, withContentType, withContentTypeHandler, withContentValueHandler, withHandlersFrom, withStaticTyping, withTypeHandler, withValueHandlerisReferenceTypeclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetTypeNameprotected final JavaType _superClass
protected final JavaType[] _superInterfaces
protected final TypeBindings _bindings
protected TypeBase(Class<?> raw, TypeBindings bindings, JavaType superClass, JavaType[] superInts, int hash, Object valueHandler, Object typeHandler, boolean asStatic)
protected TypeBase(TypeBase base)
public String toCanonical()
toCanonical in class ResolvedTypeprotected String buildCanonicalName()
public abstract StringBuilder getGenericSignature(StringBuilder sb)
getGenericSignature in class JavaTypesb - StringBuilder to append signature topublic abstract StringBuilder getErasedSignature(StringBuilder sb)
JavaTypegetErasedSignature in class JavaTypesb - StringBuilder to append signature topublic TypeBindings getBindings()
getBindings in class JavaTypepublic int containedTypeCount()
containedTypeCount in class JavaTypepublic JavaType containedType(int index)
containedType in class JavaType@Deprecated public String containedTypeName(int index)
containedTypeName in class JavaTypepublic JavaType getSuperClass()
JavaTypegetSuperClass in class JavaTypepublic List<JavaType> getInterfaces()
JavaTypegetInterfaces in class JavaTypepublic final JavaType findSuperType(Class<?> rawTarget)
JavaTypefindSuperType in class JavaTypepublic JavaType[] findTypeParameters(Class<?> expType)
JavaTypefindTypeParameters in class JavaTypepublic void serializeWithType(JsonGenerator g, SerializerProvider provider, TypeSerializer typeSer) throws IOException
JsonSerializable
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 to TypeSerializer.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.
serializeWithType in interface JsonSerializableIOExceptionpublic void serialize(JsonGenerator gen, SerializerProvider provider) throws IOException, JsonProcessingException
JsonSerializableserialize in interface JsonSerializableIOExceptionJsonProcessingExceptionprotected static StringBuilder _classSignature(Class<?> cls, StringBuilder sb, boolean trailingSemicolon)
trailingSemicolon - Whether to add trailing semicolon for non-primitive
(reference) types or notprotected static JavaType _bogusSuperClass(Class<?> cls)
Copyright © 2008–2020 FasterXML. All rights reserved.