Top Description Fields Constructors Methods
tools.jackson.datatype.hppc.ser

public abstract Class ContainerSerializerBase<T>

extends StdContainerSerializer<T>
Class Inheritance
Known Direct Subclasses
tools.jackson.datatype.hppc.ser.HppcContainerSerializers.ByteContainerSerializer, tools.jackson.datatype.hppc.ser.HppcContainerSerializers.ShortContainerSerializer, tools.jackson.datatype.hppc.ser.HppcContainerSerializers.IntContainerSerializer, tools.jackson.datatype.hppc.ser.HppcContainerSerializers.IntContainerSerializer.Indexed, tools.jackson.datatype.hppc.ser.HppcContainerSerializers.LongContainerSerializer, tools.jackson.datatype.hppc.ser.HppcContainerSerializers.CharContainerSerializer, tools.jackson.datatype.hppc.ser.HppcContainerSerializers.FloatContainerSerializer, tools.jackson.datatype.hppc.ser.HppcContainerSerializers.DoubleContainerSerializer, tools.jackson.datatype.hppc.ser.HppcContainerSerializers.BitSetSerializer, tools.jackson.datatype.hppc.ser.ObjectContainerSerializer
Imports
tools.jackson.core.*, tools.jackson.core.type.WritableTypeId, tools.jackson.databind.*, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.ser.std.StdContainerSerializer

Base class for various container (~= Collection) serializers.

Field Summary

Modifier and TypeField and Description
protected final String
Inherited from tools.jackson.databind.ser.std.StdContainerSerializer:
_dynamicValueSerializers_property

Constructor Summary

AccessConstructor and Description
protected
ContainerSerializerBase(Class<T> type, String schemaElementType)

protected
ContainerSerializerBase(JavaType type, String schemaElementType)

protected

Method Summary

Modifier and TypeMethod and Description
protected StdContainerSerializer<?>
_withValueTypeSerializer(TypeSerializer vts)

Implements abstract tools.jackson.databind.ser.std.StdContainerSerializer._withValueTypeSerializer.

Method that needs to be implemented to allow construction of a new serializer object with given TypeSerializer, used when addition type information is to be embedded.

public abstract void
public ValueSerializer<?>
getContentSerializer()

Implements abstract tools.jackson.databind.ser.std.StdContainerSerializer.getContentSerializer.

Accessor for serializer used for serializing contents (List and array elements, Map values etc) of the container for which this serializer is used, if it is known statically.

public JavaType
getContentType()

Implements abstract tools.jackson.databind.ser.std.StdContainerSerializer.getContentType.

Accessor for finding declared (static) element type for type this serializer is used for.

protected ValueSerializer<?>
public abstract boolean
isEmpty(SerializationContext ctxt, T value)

Implements abstract tools.jackson.databind.ser.std.StdContainerSerializer.isEmpty.

Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values).

public void
serialize(T value, JsonGenerator gen, SerializationContext ctxt)

Implements abstract tools.jackson.databind.ser.std.StdSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

protected abstract void
public void
serializeWithType(T value, JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer)

Overrides tools.jackson.databind.ValueSerializer.serializeWithType.

Method that can be called to ask implementation to serialize values of type this serializer handles, using specified type serializer for embedding necessary type information.

Inherited from tools.jackson.databind.ser.std.StdContainerSerializer:
_findAndAddDynamic_findAndAddDynamichasSingleElementwithValueTypeSerializer

Field Detail

_schemeElementTypeback to summary
protected final String _schemeElementType

Constructor Detail

ContainerSerializerBaseback to summary
protected ContainerSerializerBase(Class<T> type, String schemaElementType)
ContainerSerializerBaseback to summary
protected ContainerSerializerBase(JavaType type, String schemaElementType)
ContainerSerializerBaseback to summary
protected ContainerSerializerBase(ContainerSerializerBase<?> src)

Method Detail

_withValueTypeSerializerback to summary
protected StdContainerSerializer<?> _withValueTypeSerializer(TypeSerializer vts)

Implements abstract tools.jackson.databind.ser.std.StdContainerSerializer._withValueTypeSerializer.

Doc from tools.jackson.databind.ser.std.StdContainerSerializer._withValueTypeSerializer.

Method that needs to be implemented to allow construction of a new serializer object with given TypeSerializer, used when addition type information is to be embedded.

Annotations
@Override
acceptJsonFormatVisitorback to summary
public abstract void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)

Redeclares tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitable.acceptJsonFormatVisitor.

Overrides tools.jackson.databind.ser.std.StdSerializer.acceptJsonFormatVisitor.

Doc from tools.jackson.databind.ser.std.StdSerializer.acceptJsonFormatVisitor.

Default implementation specifies no format. This behavior is usually overriden by custom serializers.

Annotations
@Override
getContentSerializerback to summary
public ValueSerializer<?> getContentSerializer()

Implements abstract tools.jackson.databind.ser.std.StdContainerSerializer.getContentSerializer.

Doc from tools.jackson.databind.ser.std.StdContainerSerializer.getContentSerializer.

Accessor for serializer used for serializing contents (List and array elements, Map values etc) of the container for which this serializer is used, if it is known statically. Note that for dynamic types this may return null; if so, caller has to instead use getContentType() and tools.jackson.databind.SerializationContext#findContentValueSerializer.

Annotations
@Override
getContentTypeback to summary
public JavaType getContentType()

Implements abstract tools.jackson.databind.ser.std.StdContainerSerializer.getContentType.

Doc from tools.jackson.databind.ser.std.StdContainerSerializer.getContentType.

Accessor for finding declared (static) element type for type this serializer is used for.

Annotations
@Override
getSerializerback to summary
protected ValueSerializer<?> getSerializer(JavaType type)
isEmptyback to summary
public abstract boolean isEmpty(SerializationContext ctxt, T value)

Implements abstract tools.jackson.databind.ser.std.StdContainerSerializer.isEmpty.

Doc from tools.jackson.databind.ValueSerializer.isEmpty.

Method called to check whether given serializable value is considered "empty" value (for purposes of suppressing serialization of empty values).

Default implementation will consider only null values to be empty.

Annotations
@Override
serializeback to summary
public void serialize(T value, JsonGenerator gen, SerializationContext ctxt) throws JacksonException

Implements abstract tools.jackson.databind.ser.std.StdSerializer.serialize.

Doc from tools.jackson.databind.ValueSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

Annotations
@Override
serializeContentsback to summary
protected abstract void serializeContents(T value, JsonGenerator gen, SerializationContext ctxt) throws JacksonException
serializeWithTypeback to summary
public void serializeWithType(T value, JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer) throws JacksonException

Overrides tools.jackson.databind.ValueSerializer.serializeWithType.

Doc from tools.jackson.databind.ValueSerializer.serializeWithType.

Method that can be called to ask implementation to serialize values of type this serializer handles, using specified type serializer for embedding necessary type information.

Default implementation will throw UnsupportedOperationException to indicate that proper type handling needs to be implemented.

For simple datatypes written as a single scalar value (JSON String, Number, Boolean), implementation would look like:

  // note: method to call depends on whether this type is serialized as JSON scalar, object or Array!
  typeSer.writeTypePrefixForScalar(value, gen);
  serialize(value, gen, provider);
  typeSer.writeTypeSuffixForScalar(value, gen);
and implementations for type serialized as JSON Arrays or Objects would differ slightly, as START-ARRAY/END-ARRAY and START-OBJECT/END-OBJECT pairs need to be properly handled with respect to serializing of contents.
Annotations
@Override