Modifier and Type | Field and Description |
---|---|
protected PropertySerializerMap |
_dynamicValueSerializers
If value type can not be statically determined, mapping from runtime
value types to serializers are stored in this object.
|
protected java.util.HashSet<java.lang.String> |
_ignoredEntries
Set of entries to omit during serialization, if any
|
protected <any> |
_keySerializer
Key serializer to use, if it can be statically determined
|
protected JavaType |
_keyType
Declared type of keys
|
protected TypeSerializer |
_keyTypeSerializer
Type identifier serializer used for keys, if any.
|
protected BeanProperty |
_property
Map-valued property being serialized with this instance
|
protected <any> |
_valueSerializer
Value serializer to use, if it can be statically determined
|
protected JavaType |
_valueType
Declared type of contained values
|
protected boolean |
_valueTypeIsStatic
Whether static types should be used for serialization of values or not
(if not, dynamic runtime type is used)
|
protected TypeSerializer |
_valueTypeSerializer
Type identifier serializer used for values, if any.
|
protected static JavaType |
UNSPECIFIED_TYPE |
MAP_KEY_NAME, MAP_VALUE_NAME
Modifier | Constructor and Description |
---|---|
protected |
KeyValueMapSerializer(java.util.HashSet<java.lang.String> ignoredEntries,
JavaType keyType,
JavaType valueType,
boolean valueTypeIsStatic,
TypeSerializer kts,
TypeSerializer vts,
<any> keySerializer,
<any> valueSerializer) |
protected |
KeyValueMapSerializer(KeyValueMapSerializer src,
BeanProperty property,
<any> keySerializer,
<any> valueSerializer,
java.util.HashSet<java.lang.String> ignored) |
protected |
KeyValueMapSerializer(KeyValueMapSerializer src,
TypeSerializer vts) |
Modifier and Type | Method and Description |
---|---|
protected <any> |
_findAndAddDynamic(PropertySerializerMap map,
java.lang.Class<?> type,
SerializerProvider provider) |
protected <any> |
_findAndAddDynamic(PropertySerializerMap map,
JavaType type,
SerializerProvider provider) |
protected java.util.Map<?,?> |
_orderEntries(java.util.Map<?,?> input) |
KeyValueMapSerializer |
_withValueTypeSerializer(TypeSerializer vts) |
void |
acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor,
JavaType typeHint) |
<any> |
createContextual(SerializerProvider provider,
BeanProperty property) |
<any> |
getContentSerializer() |
JavaType |
getContentType() |
<any> |
getKeySerializer()
Accessor for currently assigned key serializer.
|
JsonNode |
getSchema(SerializerProvider provider,
java.lang.reflect.Type typeHint) |
boolean |
hasSingleElement(java.util.Map<?,?> value) |
boolean |
isEmpty(java.util.Map<?,?> value) |
void |
serialize(java.util.Map<?,?> value,
JsonGenerator jgen,
SerializerProvider provider) |
void |
serializeFields(java.util.Map<?,?> value,
JsonGenerator jgen,
SerializerProvider provider)
Method called to serialize fields, when the value type is not statically
known.
|
protected void |
serializeFieldsUsing(java.util.Map<?,?> value,
JsonGenerator jgen,
SerializerProvider provider,
<any> ser)
Method called to serialize fields, when the value type is statically
known, so that value serializer is passed and does not need to be fetched
from provider.
|
protected void |
serializeTypedFields(java.util.Map<?,?> value,
JsonGenerator jgen,
SerializerProvider provider) |
void |
serializeWithType(java.util.Map<?,?> value,
JsonGenerator jgen,
SerializerProvider provider,
TypeSerializer typeSer) |
KeyValueMapSerializer |
withResolved(BeanProperty property,
<any> keySerializer,
<any> valueSerializer,
java.util.HashSet<java.lang.String> ignored) |
protected static final JavaType UNSPECIFIED_TYPE
protected final BeanProperty _property
protected final java.util.HashSet<java.lang.String> _ignoredEntries
protected final boolean _valueTypeIsStatic
protected final JavaType _keyType
protected final JavaType _valueType
protected <any> _keySerializer
protected final TypeSerializer _keyTypeSerializer
protected <any> _valueSerializer
protected final TypeSerializer _valueTypeSerializer
protected PropertySerializerMap _dynamicValueSerializers
protected KeyValueMapSerializer(java.util.HashSet<java.lang.String> ignoredEntries, JavaType keyType, JavaType valueType, boolean valueTypeIsStatic, TypeSerializer kts, TypeSerializer vts, <any> keySerializer, <any> valueSerializer)
protected KeyValueMapSerializer(KeyValueMapSerializer src, BeanProperty property, <any> keySerializer, <any> valueSerializer, java.util.HashSet<java.lang.String> ignored)
protected KeyValueMapSerializer(KeyValueMapSerializer src, TypeSerializer vts)
public KeyValueMapSerializer _withValueTypeSerializer(TypeSerializer vts)
public KeyValueMapSerializer withResolved(BeanProperty property, <any> keySerializer, <any> valueSerializer, java.util.HashSet<java.lang.String> ignored)
public <any> createContextual(SerializerProvider provider, BeanProperty property) throws JsonMappingException
JsonMappingException
public JavaType getContentType()
public <any> getContentSerializer()
public boolean isEmpty(java.util.Map<?,?> value)
public boolean hasSingleElement(java.util.Map<?,?> value)
public <any> getKeySerializer()
MapSerializer
: depedencies are
resolved during createContextual(SerializerProvider, BeanProperty)
method (which can be overridden
by custom implementations), but for some dynamic types, it is possible
that serializer is only resolved during actual serialization.public void serialize(java.util.Map<?,?> value, JsonGenerator jgen, SerializerProvider provider) throws java.io.IOException, JsonGenerationException
java.io.IOException
JsonGenerationException
public void serializeWithType(java.util.Map<?,?> value, JsonGenerator jgen, SerializerProvider provider, TypeSerializer typeSer) throws java.io.IOException, JsonGenerationException
java.io.IOException
JsonGenerationException
public void serializeFields(java.util.Map<?,?> value, JsonGenerator jgen, SerializerProvider provider) throws java.io.IOException, JsonGenerationException
java.io.IOException
JsonGenerationException
protected void serializeFieldsUsing(java.util.Map<?,?> value, JsonGenerator jgen, SerializerProvider provider, <any> ser) throws java.io.IOException, JsonGenerationException
java.io.IOException
JsonGenerationException
protected void serializeTypedFields(java.util.Map<?,?> value, JsonGenerator jgen, SerializerProvider provider) throws java.io.IOException, JsonGenerationException
java.io.IOException
JsonGenerationException
public JsonNode getSchema(SerializerProvider provider, java.lang.reflect.Type typeHint)
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException
JsonMappingException
protected final <any> _findAndAddDynamic(PropertySerializerMap map, java.lang.Class<?> type, SerializerProvider provider) throws JsonMappingException
JsonMappingException
protected final <any> _findAndAddDynamic(PropertySerializerMap map, JavaType type, SerializerProvider provider) throws JsonMappingException
JsonMappingException
protected java.util.Map<?,?> _orderEntries(java.util.Map<?,?> input)