Package org.codehaus.jackson.map.type
Class TypeBase
- java.lang.Object
-
- org.codehaus.jackson.type.JavaType
-
- org.codehaus.jackson.map.type.TypeBase
-
- All Implemented Interfaces:
JsonSerializable
,JsonSerializableWithType
- Direct Known Subclasses:
ArrayType
,CollectionLikeType
,MapLikeType
,SimpleType
public abstract class TypeBase extends JavaType implements JsonSerializableWithType
-
-
Field Summary
-
Fields inherited from class org.codehaus.jackson.type.JavaType
_class, _hashCode, _typeHandler, _valueHandler
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static java.lang.StringBuilder
_classSignature(java.lang.Class<?> cls, java.lang.StringBuilder sb, boolean trailingSemicolon)
protected abstract java.lang.String
buildCanonicalName()
abstract java.lang.StringBuilder
getErasedSignature(java.lang.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 java.lang.StringBuilder
getGenericSignature(java.lang.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 anyvoid
serialize(JsonGenerator jgen, SerializerProvider provider)
void
serializeWithType(JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer)
java.lang.String
toCanonical()
Method that can be used to serialize type into form from which it can be fully deserialized from at a later point (usingTypeFactory
from mapper package).-
Methods inherited from class org.codehaus.jackson.type.JavaType
_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, setValueHandler, toString, widenBy, widenContentsBy, withContentTypeHandler, withContentValueHandler, withTypeHandler, withValueHandler
-
-
-
-
Method Detail
-
toCanonical
public java.lang.String toCanonical()
Description copied from class:JavaType
Method that can be used to serialize type into form from which it can be fully deserialized from at a later point (usingTypeFactory
from 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:
toCanonical
in classJavaType
-
buildCanonicalName
protected abstract java.lang.String buildCanonicalName()
-
getGenericSignature
public abstract java.lang.StringBuilder getGenericSignature(java.lang.StringBuilder sb)
- Specified by:
getGenericSignature
in classJavaType
- Parameters:
sb
- StringBuilder to append signature to- Returns:
- StringBuilder that was passed in; returned to allow call chaining
-
getErasedSignature
public abstract java.lang.StringBuilder getErasedSignature(java.lang.StringBuilder sb)
Description copied from class:JavaType
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.- Specified by:
getErasedSignature
in classJavaType
- Parameters:
sb
- StringBuilder to append signature to- Returns:
- StringBuilder that was passed in; returned to allow call chaining
-
getValueHandler
public <T> T getValueHandler()
Description copied from class:JavaType
Method for accessing value handler associated with this type, if any- Overrides:
getValueHandler
in classJavaType
-
getTypeHandler
public <T> T getTypeHandler()
Description copied from class:JavaType
Method for accessing type handler associated with this type, if any- Overrides:
getTypeHandler
in classJavaType
-
serializeWithType
public void serializeWithType(JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer) throws java.io.IOException, JsonProcessingException
- Specified by:
serializeWithType
in interfaceJsonSerializableWithType
- Throws:
java.io.IOException
JsonProcessingException
-
serialize
public void serialize(JsonGenerator jgen, SerializerProvider provider) throws java.io.IOException, JsonProcessingException
- Specified by:
serialize
in interfaceJsonSerializable
- Throws:
java.io.IOException
JsonProcessingException
-
_classSignature
protected static java.lang.StringBuilder _classSignature(java.lang.Class<?> cls, java.lang.StringBuilder sb, boolean trailingSemicolon)
- Parameters:
trailingSemicolon
- Whether to add trailing semicolon for non-primitive (reference) types or not
-
-