public abstract class TypeBase extends JavaType implements JsonSerializable
_asStatic, _class, _hash, _typeHandler, _valueHandler| Modifier | Constructor and Description |
|---|---|
protected |
TypeBase(Class<?> raw,
int hash,
Object valueHandler,
Object typeHandler)
Deprecated.
Since 2.2 use method that takes 'asStatic' argument
|
protected |
TypeBase(Class<?> raw,
int hash,
Object valueHandler,
Object typeHandler,
boolean asStatic)
Main constructor to use by extending classes.
|
| Modifier and Type | Method and Description |
|---|---|
protected static StringBuilder |
_classSignature(Class<?> cls,
StringBuilder sb,
boolean trailingSemicolon) |
protected abstract String |
buildCanonicalName() |
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) |
<T> T |
getTypeHandler()
Method for accessing type handler associated with this type, if any
|
<T> T |
getValueHandler()
Method for accessing value handler associated with this type, if any
|
void |
serialize(JsonGenerator jgen,
SerializerProvider provider)
Serialization method called when no additional type information is
to be included in serialization.
|
void |
serializeWithType(JsonGenerator jgen,
SerializerProvider provider,
TypeSerializer typeSer)
Serialization method called when additional type information is
expected to be included in serialization, for deserialization to use.
|
String |
toCanonical() |
_assertSubclass, _narrow, _widen, containedType, containedTypeCount, containedTypeName, equals, forcedNarrowBy, getContentType, getErasedSignature, getGenericSignature, getKeyType, getRawClass, hasGenericTypes, hashCode, hasRawClass, isAbstract, isArrayType, isCollectionLikeType, isConcrete, isContainerType, isEnumType, isFinal, isInterface, isMapLikeType, isPrimitive, isThrowable, narrowBy, narrowContentsBy, toString, useStaticType, widenBy, widenContentsBy, withContentTypeHandler, withContentValueHandler, withStaticTyping, withTypeHandler, withValueHandler@Deprecated protected TypeBase(Class<?> raw, int hash, Object valueHandler, Object typeHandler)
public String toCanonical()
toCanonical in class ResolvedTypeprotected abstract 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 <T> T getValueHandler()
JavaTypegetValueHandler in class JavaTypepublic <T> T getTypeHandler()
JavaTypegetTypeHandler in class JavaTypepublic void serializeWithType(JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer) throws IOException, JsonProcessingException
JsonSerializable
Usually implementation consists of a call to one of methods
in TypeSerializer (such as TypeSerializer.writeTypePrefixForObject(Object, JsonGenerator))
followed by serialization of contents,
followed by another call to TypeSerializer
(such as TypeSerializer.writeTypeSuffixForObject(Object, JsonGenerator)).
Exact methods to call in TypeSerializer 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 JsonSerializableIOExceptionJsonProcessingExceptionpublic void serialize(JsonGenerator jgen, 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 notCopyright © 2014 FasterXML. All Rights Reserved.