Top Fields Constructors Methods
tools.jackson.datatype.primitive_collections_base.ser.map

public abstract Class RefRefMapSerializer<T>

extends StdContainerSerializer<T>
Class Inheritance
Imports
java.util.HashSet, .Set, java.util.function.BiConsumer, com.fasterxml.jackson.annotation.JsonIgnoreProperties, tools.jackson.core.JacksonException, .JsonGenerator, .JsonToken, tools.jackson.core.type.WritableTypeId, tools.jackson.databind.*, tools.jackson.databind.introspect.AnnotatedMember, tools.jackson.databind.jsontype.TypeSerializer, tools.jackson.databind.ser.std.StdContainerSerializer, tools.jackson.databind.type.TypeFactory

Author
yawkat

Field Summary

Modifier and TypeField and Description
protected final Set<String>
_ignoredEntries

Set of entries to omit during serialization, if any

protected final ValueSerializer<Object>
private final JavaType
private final JavaType
protected final ValueSerializer<Object>
private final JavaType
private final TypeSerializer
Inherited from tools.jackson.databind.ser.std.StdContainerSerializer:
_dynamicValueSerializers_property

Constructor Summary

AccessConstructor and Description
public
RefRefMapSerializer(JavaType type, Class<? super T> mapClass, ValueSerializer<Object> keySerializer, TypeSerializer vts, ValueSerializer<Object> valueSerializer, Set<String> ignoredEntries)

protected
RefRefMapSerializer(RefRefMapSerializer<?> src, BeanProperty property, ValueSerializer<?> keySerializer, TypeSerializer vts, ValueSerializer<?> valueSerializer, Set<String> ignoredEntries)

Method Summary

Modifier and TypeMethod and Description
private ValueSerializer<Object>
public ValueSerializer<?>
createContextual(SerializationContext ctxt, 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).

protected abstract void
public ValueSerializer<?>
getContentSerializer()

Implements abstract tools.jackson.databind.ser.std.StdContainerSerializer.getContentSerializer.

Accessor for serializer used for serializing contents (List and array elements, Map values etc) of the container for which this serializer is used, if it is known statically.

public JavaType
getContentType()

Implements abstract tools.jackson.databind.ser.std.StdContainerSerializer.getContentType.

Accessor for finding declared (static) element type for type this serializer is used for.

protected JavaType
public void
serialize(T 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.

private void
public void
serializeWithType(T value, JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer)

Overrides tools.jackson.databind.ValueSerializer.serializeWithType.

Method that can be called to ask implementation to serialize values of type this serializer handles, using specified type serializer for embedding necessary type information.

protected abstract RefRefMapSerializer<?>
withResolved(BeanProperty property, ValueSerializer<?> keySer, TypeSerializer vts, ValueSerializer<?> valueSer, Set<String> ignored)

Inherited from tools.jackson.databind.ser.std.StdContainerSerializer:
_findAndAddDynamic_findAndAddDynamic_withValueTypeSerializerhasSingleElementisEmptywithValueTypeSerializer

Field Detail

_ignoredEntriesback to summary
protected final Set<String> _ignoredEntries

Set of entries to omit during serialization, if any

_keySerializerback to summary
protected final ValueSerializer<Object> _keySerializer
_keyTypeback to summary
private final JavaType _keyType
_typeback to summary
private final JavaType _type
_valueSerializerback to summary
protected final ValueSerializer<Object> _valueSerializer
_valueTypeback to summary
private final JavaType _valueType
_valueTypeSerializerback to summary
private final TypeSerializer _valueTypeSerializer

Constructor Detail

RefRefMapSerializerback to summary
public RefRefMapSerializer(JavaType type, Class<? super T> mapClass, ValueSerializer<Object> keySerializer, TypeSerializer vts, ValueSerializer<Object> valueSerializer, Set<String> ignoredEntries)
RefRefMapSerializerback to summary
protected RefRefMapSerializer(RefRefMapSerializer<?> src, BeanProperty property, ValueSerializer<?> keySerializer, TypeSerializer vts, ValueSerializer<?> valueSerializer, Set<String> ignoredEntries)
Annotations
@SuppressWarnings:unchecked

Method Detail

_findSerializerback to summary
private ValueSerializer<Object> _findSerializer(SerializationContext ctxt, Object value)
createContextualback to summary
public ValueSerializer<?> createContextual(SerializationContext ctxt, 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
forEachKeyValueback to summary
protected abstract void forEachKeyValue(T value, BiConsumer<Object, Object> action)
getContentSerializerback to summary
public ValueSerializer<?> getContentSerializer()

Implements abstract tools.jackson.databind.ser.std.StdContainerSerializer.getContentSerializer.

Doc from tools.jackson.databind.ser.std.StdContainerSerializer.getContentSerializer.

Accessor for serializer used for serializing contents (List and array elements, Map values etc) of the container for which this serializer is used, if it is known statically. Note that for dynamic types this may return null; if so, caller has to instead use getContentType() and tools.jackson.databind.SerializationContext#findContentValueSerializer.

Annotations
@Override
getContentTypeback to summary
public JavaType getContentType()

Implements abstract tools.jackson.databind.ser.std.StdContainerSerializer.getContentType.

Doc from tools.jackson.databind.ser.std.StdContainerSerializer.getContentType.

Accessor for finding declared (static) element type for type this serializer is used for.

Annotations
@Override
getKeyTypeback to summary
protected JavaType getKeyType()
serializeback to summary
public void serialize(T 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
serializeFieldsback to summary
private void serializeFields(T value, JsonGenerator gen, SerializationContext ctxt)
serializeWithTypeback to summary
public void serializeWithType(T value, JsonGenerator gen, SerializationContext ctxt, TypeSerializer typeSer) throws JacksonException

Overrides tools.jackson.databind.ValueSerializer.serializeWithType.

Doc from tools.jackson.databind.ValueSerializer.serializeWithType.

Method that can be called to ask implementation to serialize values of type this serializer handles, using specified type serializer for embedding necessary type information.

Default implementation will throw UnsupportedOperationException to indicate that proper type handling needs to be implemented.

For simple datatypes written as a single scalar value (JSON String, Number, Boolean), implementation would look like:

  // note: method to call depends on whether this type is serialized as JSON scalar, object or Array!
  typeSer.writeTypePrefixForScalar(value, gen);
  serialize(value, gen, provider);
  typeSer.writeTypeSuffixForScalar(value, gen);
and implementations for type serialized as JSON Arrays or Objects would differ slightly, as START-ARRAY/END-ARRAY and START-OBJECT/END-OBJECT pairs need to be properly handled with respect to serializing of contents.
Annotations
@Override
withResolvedback to summary
protected abstract RefRefMapSerializer<?> withResolved(BeanProperty property, ValueSerializer<?> keySer, TypeSerializer vts, ValueSerializer<?> valueSer, Set<String> ignored)