public class StreamSerializer extends StdSerializer<Stream<?>> implements ContextualSerializer
JsonSerializer.None
_handledType
Constructor and Description |
---|
StreamSerializer(JavaType streamType,
JavaType elemType)
Constructor
|
StreamSerializer(JavaType streamType,
JavaType elemType,
JsonSerializer<Object> elemSerializer)
Constructor with custom serializer
|
Modifier and Type | Method and Description |
---|---|
JsonSerializer<?> |
createContextual(SerializerProvider provider,
BeanProperty property)
Method called to see if a different (or differently configured) serializer
is needed to serialize values of specified property.
|
void |
serialize(Stream<?> stream,
JsonGenerator jgen,
SerializerProvider provider)
Method that can be called to ask implementation to serialize
values of type this serializer handles.
|
_neitherNull, _nonEmpty, acceptJsonFormatVisitor, createSchemaNode, createSchemaNode, findAnnotatedContentSerializer, findContextualConvertingSerializer, findConvertingContentSerializer, findFormatFeature, findFormatOverrides, findIncludeOverrides, findPropertyFilter, getSchema, getSchema, handledType, isDefaultSerializer, visitArrayFormat, visitArrayFormat, visitFloatFormat, visitIntFormat, visitIntFormat, visitStringFormat, visitStringFormat, wrapAndThrow, wrapAndThrow
getDelegatee, isEmpty, isEmpty, isUnwrappingSerializer, properties, replaceDelegatee, serializeWithType, unwrappingSerializer, usesObjectId, withFilterId
public StreamSerializer(JavaType streamType, JavaType elemType)
streamType
- Stream typeelemType
- Stream elements type (matching T)public StreamSerializer(JavaType streamType, JavaType elemType, JsonSerializer<Object> elemSerializer)
streamType
- Stream typeelemType
- Stream elements type (matching T)elemSerializer
- Custom serializer to use for element typepublic JsonSerializer<?> createContextual(SerializerProvider provider, BeanProperty property) throws JsonMappingException
ContextualSerializer
createContextual
in interface ContextualSerializer
provider
- Serializer provider to use for accessing config, other serializersproperty
- Method or field that represents the property
(and is used to access value to serialize).
Should be available; but there may be cases where caller cannot provide it and
null is passed instead (in which case impls usually pass 'this' serializer as is)JsonMappingException
public void serialize(Stream<?> stream, JsonGenerator jgen, SerializerProvider provider) throws IOException
JsonSerializer
serialize
in class StdSerializer<Stream<?>>
stream
- Value to serialize; can not be null.jgen
- Generator used to output resulting Json contentprovider
- Provider that can be used to get serializers for
serializing Objects value contains, if any.IOException
Copyright © 2019 JBoss by Red Hat. All rights reserved.