Top Fields Constructors Methods
tools.jackson.datatype.primitive_collections_base.ser

public abstract Class PrimitiveIterableSerializer<C>

extends StdContainerSerializer<C>
Class Inheritance
Imports
tools.jackson.core.JacksonException, .JsonGenerator, .JsonToken, tools.jackson.core.type.WritableTypeId, tools.jackson.databind.*, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.ser.std.StdContainerSerializer

Field Summary

Modifier and TypeField and Description
protected final JavaType
protected final BeanProperty
protected final Boolean
Inherited from tools.jackson.databind.ser.std.StdContainerSerializer:
_dynamicValueSerializers

Constructor Summary

AccessConstructor and Description
protected
PrimitiveIterableSerializer(Class<C> type, JavaType elementType, BeanProperty property, Boolean unwrapSingle)

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 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.

public final void
serialize(C 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(C value, JsonGenerator g, 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_findAndAddDynamichasSingleElementisEmptywithValueTypeSerializer

Field Detail

_elementTypeback to summary
protected final JavaType _elementType
_propertyback to summary
protected final BeanProperty _property

Hides tools.jackson.databind.ser.std.StdContainerSerializer._property.

_unwrapSingleback to summary
protected final Boolean _unwrapSingle

Constructor Detail

PrimitiveIterableSerializerback to summary
protected PrimitiveIterableSerializer(Class<C> type, JavaType elementType, BeanProperty property, Boolean unwrapSingle)

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
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
serializeback to summary
public final void serialize(C 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(C value, JsonGenerator gen) throws JacksonException
serializeWithTypeback to summary
public void serializeWithType(C value, JsonGenerator g, 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