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

public Class UUIDSerializer

extends StdScalarSerializer<UUID>
Class Inheritance
Imports
java.util.Objects, .UUID, com.fasterxml.jackson.annotation.JsonFormat, tools.jackson.core.JacksonException, .JsonGenerator, .StreamWriteCapability, tools.jackson.databind.*, tools.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper, .JsonValueFormat, tools.jackson.databind.ser.std.StdScalarSerializer

Specialized ValueSerializer to output java.util.UUIDs. Beyond optimized access and writing of textual representation (which is the default handling in most cases), it will alternatively allow serialization using raw binary output (as 16-byte block) if underlying data format has efficient means to access that.

Field Summary

Modifier and TypeField and Description
protected final Boolean
_asBinary

Configuration setting that indicates if serialization as binary (native or Base64-encoded) has been forced; null means "use default heuristic"

pack-priv static final char[]

Constructor Summary

AccessConstructor and Description
public
protected

Method Summary

Modifier and TypeMethod and Description
private static void
_appendInt(int bits, char[] ch, int offset)

private static final void
_appendInt(int value, byte[] buffer, int offset)

private static void
_appendShort(int bits, char[] ch, int offset)

private static final byte[]
_asBytes(UUID uuid)

protected boolean
public void
public ValueSerializer<?>
createContextual(SerializationContext serializers, 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 boolean
isEmpty(SerializationContext prov, UUID value)

Overrides 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).

public void
serialize(UUID value, JsonGenerator gen, 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.StdScalarSerializer:
serializeWithType

Field Detail

_asBinaryback to summary
protected final Boolean _asBinary

Configuration setting that indicates if serialization as binary (native or Base64-encoded) has been forced; null means "use default heuristic"

HEX_CHARSback to summary
pack-priv static final char[] HEX_CHARS

Constructor Detail

UUIDSerializerback to summary
public UUIDSerializer()
UUIDSerializerback to summary
protected UUIDSerializer(Boolean asBinary)

Method Detail

_appendIntback to summary
private static void _appendInt(int bits, char[] ch, int offset)
_appendIntback to summary
private static final void _appendInt(int value, byte[] buffer, int offset)
_appendShortback to summary
private static void _appendShort(int bits, char[] ch, int offset)
_asBytesback to summary
private static final byte[] _asBytes(UUID uuid)
_writeAsBinaryback to summary
protected boolean _writeAsBinary(SerializationContext ctxt)
acceptJsonFormatVisitorback to summary
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint)

Overrides tools.jackson.databind.ser.std.StdScalarSerializer.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
createContextualback to summary
public ValueSerializer<?> createContextual(SerializationContext serializers, 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
isEmptyback to summary
public boolean isEmpty(SerializationContext prov, UUID value)

Overrides tools.jackson.databind.ValueSerializer.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 void serialize(UUID value, JsonGenerator gen, 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