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

public Class TokenBufferSerializer

extends StdSerializer<TokenBuffer>
Class Inheritance
Annotations
@JacksonStdImpl
Imports
tools.jackson.core.*, tools.jackson.core.type.WritableTypeId, tools.jackson.databind.JavaType, .SerializationContext, tools.jackson.databind.annotation.JacksonStdImpl, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.ser.std.StdSerializer, tools.jackson.databind.util.TokenBuffer

We also want to directly support serialization of TokenBuffer; and since it is part of core package, it cannot implement tools.jackson.databind.JacksonSerializable (which is only included in the mapper package)

Field Summary

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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
serialize(TokenBuffer value, JsonGenerator jgen, 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 final void
serializeWithType(TokenBuffer value, JsonGenerator g, SerializationContext ctxt, TypeSerializer typeSer)

Overrides tools.jackson.databind.ValueSerializer.serializeWithType.

Implementing typed output for contents of a TokenBuffer is very tricky, since we do not know for sure what its contents might look like (or, rather, we do know when serializing, but not necessarily when deserializing!) One possibility would be to check the current token, and use that to determine if we would output JSON Array, Object or scalar value.

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

Constructor Detail

TokenBufferSerializerback to summary
public TokenBufferSerializer()

Method Detail

acceptJsonFormatVisitorback to summary
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)

Overrides tools.jackson.databind.ser.std.StdSerializer.acceptJsonFormatVisitor.

Implements tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitable.acceptJsonFormatVisitor.

Doc from tools.jackson.databind.ser.std.StdSerializer.acceptJsonFormatVisitor.

Default implementation specifies no format. This behavior is usually overriden by custom serializers.

Annotations
@Override
serializeback to summary
public void serialize(TokenBuffer value, JsonGenerator jgen, 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
serializeWithTypeback to summary
public final void serializeWithType(TokenBuffer value, JsonGenerator g, SerializationContext ctxt, TypeSerializer typeSer) throws JacksonException

Overrides tools.jackson.databind.ValueSerializer.serializeWithType.

Implementing typed output for contents of a TokenBuffer is very tricky, since we do not know for sure what its contents might look like (or, rather, we do know when serializing, but not necessarily when deserializing!) One possibility would be to check the current token, and use that to determine if we would output JSON Array, Object or scalar value.

Note that we just claim it is scalar; this should work ok and is simpler than doing introspection on both serialization and deserialization.

Annotations
@Override