Top Description Fields Constructors Methods
tools.jackson.databind.ser.jdk

public final Class IndexedListSerializer

extends AsArraySerializerBase<Object>
Class Inheritance
Annotations
@JacksonStdImpl
Imports
java.util.*, tools.jackson.core.JacksonException, .JsonGenerator, tools.jackson.databind.*, tools.jackson.databind.annotation.JacksonStdImpl, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.ser.impl.PropertySerializerMap, tools.jackson.databind.ser.std.AsArraySerializerBase, .StdContainerSerializer

This is an optimized serializer for Lists that can be efficiently traversed by index (as opposed to others, such as LinkedList that cannot}.

Field Summary

Inherited from tools.jackson.databind.ser.std.AsArraySerializerBase:
_elementSerializer_elementType_staticTyping_unwrapSingle_valueTypeSerializer

Constructor Summary

AccessConstructor and Description
public
IndexedListSerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, ValueSerializer<Object> valueSerializer)

public
IndexedListSerializer(IndexedListSerializer src, TypeSerializer vts, ValueSerializer<?> valueSerializer, Boolean unwrapSingle, BeanProperty property)

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 boolean
hasSingleElement(Object value)

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

Method called to determine if the given value (of type handled by this serializer) contains exactly one element.

public boolean
isEmpty(SerializationContext prov, Object 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 final void
serialize(Object value0, JsonGenerator gen, SerializationContext provider)

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.

public void
public void
public void
public IndexedListSerializer
Inherited from tools.jackson.databind.ser.std.AsArraySerializerBase:
acceptJsonFormatVisitorcreateContextualgetContentSerializergetContentTypeserializeWithType

Constructor Detail

IndexedListSerializerback to summary
public IndexedListSerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, ValueSerializer<Object> valueSerializer)
IndexedListSerializerback to summary
public IndexedListSerializer(IndexedListSerializer src, TypeSerializer vts, ValueSerializer<?> valueSerializer, Boolean unwrapSingle, BeanProperty property)

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
hasSingleElementback to summary
public boolean hasSingleElement(Object value)

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

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

Method called to determine if the given value (of type handled by this serializer) contains exactly one element.

Note

although it might seem sensible to instead define something like "getElementCount()" method, this would not work well for containers that do not keep track of size (like linked lists may not).

Note, too, that this method is only called by serializer itself; and specifically is not used for non-array/collection types like Map or Map.Entry instances.

Annotations
@Override
isEmptyback to summary
public boolean isEmpty(SerializationContext prov, Object 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 final void serialize(Object value0, JsonGenerator gen, SerializationContext provider) 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
public void serializeContents(Object value0, JsonGenerator g, SerializationContext ctxt) throws JacksonException

Implements abstract tools.jackson.databind.ser.std.AsArraySerializerBase.serializeContents.

Annotations
@Override
serializeContentsUsingback to summary
public void serializeContentsUsing(List<?> value, JsonGenerator jgen, SerializationContext provider, ValueSerializer<Object> ser) throws JacksonException
serializeTypedContentsback to summary
public void serializeTypedContents(List<?> value, JsonGenerator g, SerializationContext ctxt) throws JacksonException
withResolvedback to summary
public IndexedListSerializer withResolved(BeanProperty property, TypeSerializer vts, ValueSerializer<?> elementSerializer, Boolean unwrapSingle)

Implements abstract tools.jackson.databind.ser.std.AsArraySerializerBase.withResolved.

Annotations
@Override