Top Description Fields Constructors Methods
tools.jackson.databind.ext.jdk8

public Class Jdk8StreamSerializer

extends StdSerializer<Stream<?>>
Class Inheritance
Imports
java.util.stream.Stream, tools.jackson.core.JacksonException, .JsonGenerator, tools.jackson.databind.*, tools.jackson.databind.ser.std.StdSerializer

Common typed stream serializer

Field Summary

Modifier and TypeField and Description
private final transient ValueSerializer<Object>
elemSerializer

element specific serializer, if any

private final JavaType
elemType

Stream elements type (matching T)

Inherited from tools.jackson.databind.ser.std.StdSerializer:
_handledType

Constructor Summary

AccessConstructor and Description
public
Jdk8StreamSerializer(JavaType
Stream type
streamType
,
JavaType
Stream elements type (matching T)
elemType
)

Constructor

public
Jdk8StreamSerializer(JavaType
Stream type
streamType
,
JavaType
Stream elements type (matching T)
elemType
,
ValueSerializer<Object>
Custom serializer to use for element type
elemSerializer
)

Constructor with custom serializer

Method Summary

Modifier and TypeMethod and Description
public ValueSerializer<?>
createContextual(SerializationContext provider, BeanProperty property)

Overrides tools.jackson.databind.ValueSerializer.createContextual.

Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property (or, for root values, in which case `null` is passed).

public void
serialize(Stream<?> stream, JsonGenerator g, 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.

Inherited from tools.jackson.databind.ser.std.StdSerializer:
_neitherNull_nonEmpty_wrapIOFailureacceptJsonFormatVisitoracceptJsonFormatVisitorForBinarycreateSchemaNodecreateSchemaNodefindAnnotatedContentSerializerfindContextualConvertingSerializerfindFormatFeaturefindFormatOverridesfindIncludeOverridesfindPropertyFilterhandledTypeisDefaultSerializervisitArrayFormatvisitArrayFormatvisitFloatFormatvisitIntFormatvisitIntFormatvisitStringFormatvisitStringFormatwrapAndThrowwrapAndThrow

Field Detail

elemSerializerback to summary
private final transient ValueSerializer<Object> elemSerializer

element specific serializer, if any

elemTypeback to summary
private final JavaType elemType

Stream elements type (matching T)

Constructor Detail

Jdk8StreamSerializerback to summary
public Jdk8StreamSerializer(JavaType streamType, JavaType elemType)

Constructor

Parameters
streamType:JavaType

Stream type

elemType:JavaType

Stream elements type (matching T)

Jdk8StreamSerializerback to summary
public Jdk8StreamSerializer(JavaType streamType, JavaType elemType, ValueSerializer<Object> elemSerializer)

Constructor with custom serializer

Parameters
streamType:JavaType

Stream type

elemType:JavaType

Stream elements type (matching T)

elemSerializer:ValueSerializer<Object>

Custom serializer to use for element type

Method Detail

createContextualback to summary
public ValueSerializer<?> createContextual(SerializationContext provider, BeanProperty property)

Overrides tools.jackson.databind.ValueSerializer.createContextual.

Doc from tools.jackson.databind.ValueSerializer.createContextual.

Method called to see if a different (or differently configured) serializer is needed to serialize values of specified property (or, for root values, in which case `null` is passed). Note that instance that this method is called on is typically shared one and as a result method should NOT modify this instance but rather construct and return a new instance. This instance should only be returned as-is, in case it is already suitable for use.

Note that method is only called once per POJO property, and for the first usage as root value serializer; it is not called for every serialization, as doing that would have significant performance impact; most serializers cache contextual instances for future use.

Annotations
@Override
serializeback to summary
public void serialize(Stream<?> stream, JsonGenerator g, 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