Top Fields Constructors Methods
com.fasterxml.jackson.databind.ser.std

public Class IterableSerializer

extends AsArraySerializerBase<Iterable<?>>
Class Inheritance
Annotations
@JacksonStdImpl
@SuppressWarnings:serial
Imports
java.io.IOException, java.util.*, com.fasterxml.jackson.core.*, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.annotation.JacksonStdImpl, com.fasterxml.jackson.databind.jsontype.TypeSerializer, com.fasterxml.jackson.databind.ser.ContainerSerializer

References Deprecated

AsArraySerializerBase is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Field Summary

Inherited from com.fasterxml.jackson.databind.ser.std.AsArraySerializerBase:
_dynamicSerializers_elementSerializer_elementType_property_staticTyping_unwrapSingle_valueTypeSerializer

Constructor Summary

AccessConstructor and Description
public
IterableSerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts)

public
IterableSerializer(IterableSerializer src, BeanProperty property, TypeSerializer vts, JsonSerializer<?> valueSerializer, Boolean unwrapSingle)
References Deprecated IterableSerializer is deprecated or references (maybe indirectly) at least one deprecated element.

Method Summary

Modifier and TypeMethod and Description
public ContainerSerializer<?>
_withValueTypeSerializer(TypeSerializer vts)

Implements abstract com.fasterxml.jackson.databind.ser.ContainerSerializer._withValueTypeSerializer.

References Deprecated ContainerSerializer is deprecated or references (maybe indirectly) at least one deprecated element.

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(Iterable<?> value)

Implements abstract com.fasterxml.jackson.databind.ser.ContainerSerializer.hasSingleElement.

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

public boolean
isEmpty(SerializerProvider prov, Iterable<?> value)

Overrides com.fasterxml.jackson.databind.JsonSerializer.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(Iterable<?>
Value to serialize; can not be null.
value
,
JsonGenerator
Generator used to output resulting Json content
gen
,
SerializerProvider
Provider that can be used to get serializers for serializing Objects value contains, if any.
provider
)

Overrides com.fasterxml.jackson.databind.ser.std.AsArraySerializerBase.serialize.

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

public void
public IterableSerializer
withResolved(BeanProperty property, TypeSerializer vts, JsonSerializer<?> elementSerializer, Boolean unwrapSingle)

Implements abstract com.fasterxml.jackson.databind.ser.std.AsArraySerializerBase.withResolved.

References Deprecated IterableSerializer is deprecated or references (maybe indirectly) at least one deprecated element.

Inherited from com.fasterxml.jackson.databind.ser.std.AsArraySerializerBase:
_findAndAddDynamic_findAndAddDynamicacceptJsonFormatVisitorcreateContextualgetContentSerializergetContentTypegetSchemaserializeWithTypewithResolved

Constructor Detail

IterableSerializerback to summary
public IterableSerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts)
IterableSerializerback to summary
public IterableSerializer(IterableSerializer src, BeanProperty property, TypeSerializer vts, JsonSerializer<?> valueSerializer, Boolean unwrapSingle)

References Deprecated

IterableSerializer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Method Detail

_withValueTypeSerializerback to summary
public ContainerSerializer<?> _withValueTypeSerializer(TypeSerializer vts)

Implements abstract com.fasterxml.jackson.databind.ser.ContainerSerializer._withValueTypeSerializer.

Doc from com.fasterxml.jackson.databind.ser.ContainerSerializer._withValueTypeSerializer.

References Deprecated

ContainerSerializer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

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(Iterable<?> value)

Implements abstract com.fasterxml.jackson.databind.ser.ContainerSerializer.hasSingleElement.

Doc from com.fasterxml.jackson.databind.ser.ContainerSerializer.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 as of now (2.9) 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(SerializerProvider prov, Iterable<?> value)

Overrides com.fasterxml.jackson.databind.JsonSerializer.isEmpty.

Doc from com.fasterxml.jackson.databind.JsonSerializer.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.

Note

replaces isEmpty(Object), which was deprecated in 2.5

Annotations
@Override
serializeback to summary
public final void serialize(Iterable<?> value, JsonGenerator gen, SerializerProvider provider) throws IOException

Overrides com.fasterxml.jackson.databind.ser.std.AsArraySerializerBase.serialize.

Doc from com.fasterxml.jackson.databind.JsonSerializer.serialize.

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

Parameters
value:Iterable<?>

Value to serialize; can not be null.

gen:JsonGenerator

Generator used to output resulting Json content

provider:SerializerProvider

Provider that can be used to get serializers for serializing Objects value contains, if any.

Annotations
@Override
serializeContentsback to summary
public void serializeContents(Iterable<?> value, JsonGenerator jgen, SerializerProvider provider) throws IOException

Implements abstract com.fasterxml.jackson.databind.ser.std.AsArraySerializerBase.serializeContents.

Annotations
@Override
withResolvedback to summary
public IterableSerializer withResolved(BeanProperty property, TypeSerializer vts, JsonSerializer<?> elementSerializer, Boolean unwrapSingle)

Implements abstract com.fasterxml.jackson.databind.ser.std.AsArraySerializerBase.withResolved.

References Deprecated

IterableSerializer is deprecated or references (maybe indirectly) at least one deprecated element.

See corresponding docs for further information.

Annotations
@Override