Top Inners Fields Constructors Methods
com.fasterxml.jackson.databind.ser.std

public abstract Class StdKeySerializers

extends Object
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.io.IOException, java.util.Calendar, .Date, com.fasterxml.jackson.core.*, com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.introspect.AnnotatedClass, com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper, com.fasterxml.jackson.databind.ser.impl.PropertySerializerMap, com.fasterxml.jackson.databind.util.ClassUtil, .EnumValues

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
StdKeySerializers.Default

Deprecated as a consequence of StdSerializer being deprecated.
This is a "chameleon" style multi-type key serializer for simple standard JDK types.
public static class
StdKeySerializers.Dynamic

Deprecated as a consequence of StdSerializer being deprecated.
Key serializer used when key type is not known statically, and actual key serializer needs to be dynamically located.
public static class
StdKeySerializers.EnumKeySerializer

Deprecated as a consequence of StdSerializer being deprecated.
Specialized instance to use for Enum keys, as per [databind#1322]
public static class
StdKeySerializers.StringKeySerializer

Deprecated as a consequence of StdSerializer being deprecated.
Simple and fast key serializer when keys are Strings.

Field Summary

Modifier and TypeField and Description
protected static final JsonSerializer<Object>
protected static final JsonSerializer<Object>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static JsonSerializer<Object>
getDefault()

Deprecated since 2.7
public static JsonSerializer<Object>
getFallbackKeySerializer(SerializationConfig config, Class<?> rawKeyType, AnnotatedClass annotatedClass)

Method called if no specified key serializer was located; will return a "default" key serializer initialized by EnumKeySerializer#construct(Class, EnumValues, EnumValues)

public static JsonSerializer<Object>
getStdKeySerializer(SerializationConfig
Serialization configuration in use, may be needed in choosing serializer to use
config
,
Class<?>
Type of key values to serialize
rawKeyType
,
boolean
If no match is found, should we return fallback deserializer (true), or null (false)?
useDefault
)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_KEY_SERIALIZERback to summary
protected static final JsonSerializer<Object> DEFAULT_KEY_SERIALIZER
Annotations
@SuppressWarnings:deprecation
DEFAULT_STRING_SERIALIZERback to summary
protected static final JsonSerializer<Object> DEFAULT_STRING_SERIALIZER

Constructor Detail

StdKeySerializersback to summary
public StdKeySerializers()

Method Detail

getDefaultback to summary
public static JsonSerializer<Object> getDefault()

Deprecated

since 2.7

Annotations
@Deprecated
getFallbackKeySerializerback to summary
public static JsonSerializer<Object> getFallbackKeySerializer(SerializationConfig config, Class<?> rawKeyType, AnnotatedClass annotatedClass)

Method called if no specified key serializer was located; will return a "default" key serializer initialized by EnumKeySerializer#construct(Class, EnumValues, EnumValues)

Annotations
@SuppressWarnings:unchecked
Since
2.15
getStdKeySerializerback to summary
public static JsonSerializer<Object> getStdKeySerializer(SerializationConfig config, Class<?> rawKeyType, boolean useDefault)
Parameters
config:SerializationConfig

Serialization configuration in use, may be needed in choosing serializer to use

rawKeyType:Class<?>

Type of key values to serialize

useDefault:boolean

If no match is found, should we return fallback deserializer (true), or null (false)?

com.fasterxml.jackson.databind.ser.std back to summary

public Class StdKeySerializers.Default

extends StdSerializer<Object>
Class Inheritance

Deprecated

as a consequence of StdSerializer being deprecated. See corresponding docs for further information.

This is a "chameleon" style multi-type key serializer for simple standard JDK types.

TODO: Should (but does not yet) support re-configuring format used for java.util.Date and java.util.Calendar key serializers, as well as alternative configuration of Enum key serializers.

Field Summary

Modifier and TypeField and Description
protected final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
Inherited from com.fasterxml.jackson.databind.ser.std.StdSerializer:
_handledType

Constructor Summary

AccessConstructor and Description
public
Default(int typeId, Class<?> type)

Method Summary

Modifier and TypeMethod and Description
public void
serialize(Object
Value to serialize; can not be null.
value
,
JsonGenerator
Generator used to output resulting Json content
g
,
SerializerProvider
Provider that can be used to get serializers for serializing Objects value contains, if any.
provider
)

Implements abstract com.fasterxml.jackson.databind.ser.std.StdSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.
Inherited from com.fasterxml.jackson.databind.ser.std.StdSerializer:
_neitherNull_nonEmptyacceptJsonFormatVisitorcreateSchemaNodecreateSchemaNodefindAnnotatedContentSerializerfindContextualConvertingSerializerfindConvertingContentSerializerfindFormatFeaturefindFormatOverridesfindIncludeOverridesfindPropertyFiltergetSchemagetSchemahandledTypeisDefaultSerializervisitArrayFormatvisitArrayFormatvisitFloatFormatvisitIntFormatvisitIntFormatvisitStringFormatvisitStringFormatwrapAndThrowwrapAndThrow

Field Detail

_typeIdback to summary
protected final int _typeId
TYPE_BYTE_ARRAYback to summary
pack-priv static final int TYPE_BYTE_ARRAY
TYPE_CALENDARback to summary
pack-priv static final int TYPE_CALENDAR
TYPE_CLASSback to summary
pack-priv static final int TYPE_CLASS
TYPE_DATEback to summary
pack-priv static final int TYPE_DATE
TYPE_ENUMback to summary
pack-priv static final int TYPE_ENUM
TYPE_INTEGERback to summary
pack-priv static final int TYPE_INTEGER
TYPE_LONGback to summary
pack-priv static final int TYPE_LONG
TYPE_TO_STRINGback to summary
pack-priv static final int TYPE_TO_STRING

Constructor Detail

Defaultback to summary
public Default(int typeId, Class<?> type)

Method Detail

serializeback to summary
public void serialize(Object value, JsonGenerator g, SerializerProvider provider) throws IOException

Implements abstract com.fasterxml.jackson.databind.ser.std.StdSerializer.serialize.

Doc from com.fasterxml.jackson.databind.JsonSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

Parameters
value:Object

Value to serialize; can not be null.

g:JsonGenerator

Generator used to output resulting Json content

provider:SerializerProvider

Provider that can be used to get serializers for serializing Objects value contains, if any.

Annotations
@Override
com.fasterxml.jackson.databind.ser.std back to summary

public Class StdKeySerializers.Dynamic

extends StdSerializer<Object>
Class Inheritance

Deprecated

as a consequence of StdSerializer being deprecated. See corresponding docs for further information.

Key serializer used when key type is not known statically, and actual key serializer needs to be dynamically located.

Field Summary

Modifier and TypeField and Description
protected transient PropertySerializerMap
Inherited from com.fasterxml.jackson.databind.ser.std.StdSerializer:
_handledType

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected JsonSerializer<Object>
public void
pack-priv Object
public void
serialize(Object
Value to serialize; can not be null.
value
,
JsonGenerator
Generator used to output resulting Json content
g
,
SerializerProvider
Provider that can be used to get serializers for serializing Objects value contains, if any.
provider
)

Implements abstract com.fasterxml.jackson.databind.ser.std.StdSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.
Inherited from com.fasterxml.jackson.databind.ser.std.StdSerializer:
_neitherNull_nonEmptycreateSchemaNodecreateSchemaNodefindAnnotatedContentSerializerfindContextualConvertingSerializerfindConvertingContentSerializerfindFormatFeaturefindFormatOverridesfindIncludeOverridesfindPropertyFiltergetSchemagetSchemahandledTypeisDefaultSerializervisitArrayFormatvisitArrayFormatvisitFloatFormatvisitIntFormatvisitIntFormatvisitStringFormatvisitStringFormatwrapAndThrowwrapAndThrow

Field Detail

_dynamicSerializersback to summary
protected transient PropertySerializerMap _dynamicSerializers

Constructor Detail

Dynamicback to summary
public Dynamic()

Method Detail

_findAndAddDynamicback to summary
protected JsonSerializer<Object> _findAndAddDynamic(PropertySerializerMap map, Class<?> type, SerializerProvider provider) throws JsonMappingException
acceptJsonFormatVisitorback to summary
public void acceptJsonFormatVisitor(JsonFormatVisitorWrapper visitor, JavaType typeHint) throws JsonMappingException

Overrides com.fasterxml.jackson.databind.ser.std.StdSerializer.acceptJsonFormatVisitor.

Implements com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable.acceptJsonFormatVisitor.

Doc from com.fasterxml.jackson.databind.ser.std.StdSerializer.acceptJsonFormatVisitor.

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

Parameters
typeHint:JavaType

Doc from com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitable.acceptJsonFormatVisitor.

Type of element (entity like property) being visited

Annotations
@Override
readResolveback to summary
pack-priv Object readResolve()
serializeback to summary
public void serialize(Object value, JsonGenerator g, SerializerProvider provider) throws IOException

Implements abstract com.fasterxml.jackson.databind.ser.std.StdSerializer.serialize.

Doc from com.fasterxml.jackson.databind.JsonSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

Parameters
value:Object

Value to serialize; can not be null.

g:JsonGenerator

Generator used to output resulting Json content

provider:SerializerProvider

Provider that can be used to get serializers for serializing Objects value contains, if any.

Annotations
@Override
com.fasterxml.jackson.databind.ser.std back to summary

public Class StdKeySerializers.EnumKeySerializer

extends StdSerializer<Object>
Class Inheritance

Deprecated

as a consequence of StdSerializer being deprecated. See corresponding docs for further information.

Specialized instance to use for Enum keys, as per [databind#1322]
Since
2.8

Field Summary

Modifier and TypeField and Description
protected final EnumValues
protected final EnumValues
_valuesByEnumNaming

Map with key as converted property class defined implementation of EnumNamingStrategy and with value as Enum names collected using Enum.name().

Inherited from com.fasterxml.jackson.databind.ser.std.StdSerializer:
_handledType

Constructor Summary

AccessConstructor and Description
protected
EnumKeySerializer(Class<?> enumType, EnumValues values)

protected
EnumKeySerializer(Class<?> enumType, EnumValues values, EnumValues valuesByEnumNaming)

Method Summary

Modifier and TypeMethod and Description
public static StdKeySerializers.EnumKeySerializer
construct(Class<?> enumType, EnumValues enumValues)

Deprecated as a consequence of StdKeySerializers.EnumKeySerializer being deprecated.
public static StdKeySerializers.EnumKeySerializer
construct(Class<?> enumType, EnumValues enumValues, EnumValues valuesByEnumNaming)

Deprecated as a consequence of StdKeySerializers.EnumKeySerializer being deprecated.
public void
serialize(Object
Value to serialize; can not be null.
value
,
JsonGenerator
Generator used to output resulting Json content
g
,
SerializerProvider
Provider that can be used to get serializers for serializing Objects value contains, if any.
serializers
)

Implements abstract com.fasterxml.jackson.databind.ser.std.StdSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.
Inherited from com.fasterxml.jackson.databind.ser.std.StdSerializer:
_neitherNull_nonEmptyacceptJsonFormatVisitorcreateSchemaNodecreateSchemaNodefindAnnotatedContentSerializerfindContextualConvertingSerializerfindConvertingContentSerializerfindFormatFeaturefindFormatOverridesfindIncludeOverridesfindPropertyFiltergetSchemagetSchemahandledTypeisDefaultSerializervisitArrayFormatvisitArrayFormatvisitFloatFormatvisitIntFormatvisitIntFormatvisitStringFormatvisitStringFormatwrapAndThrowwrapAndThrow

Field Detail

_valuesback to summary
protected final EnumValues _values
_valuesByEnumNamingback to summary
protected final EnumValues _valuesByEnumNaming

Map with key as converted property class defined implementation of EnumNamingStrategy and with value as Enum names collected using Enum.name().

Since
2.15

Constructor Detail

EnumKeySerializerback to summary
protected EnumKeySerializer(Class<?> enumType, EnumValues values)
EnumKeySerializerback to summary
protected EnumKeySerializer(Class<?> enumType, EnumValues values, EnumValues valuesByEnumNaming)
Since
2.15

Method Detail

constructback to summary
public static StdKeySerializers.EnumKeySerializer construct(Class<?> enumType, EnumValues enumValues)

Deprecated

as a consequence of StdKeySerializers.EnumKeySerializer being deprecated. See corresponding docs for further information.

constructback to summary
public static StdKeySerializers.EnumKeySerializer construct(Class<?> enumType, EnumValues enumValues, EnumValues valuesByEnumNaming)

Deprecated

as a consequence of StdKeySerializers.EnumKeySerializer being deprecated. See corresponding docs for further information.

serializeback to summary
public void serialize(Object value, JsonGenerator g, SerializerProvider serializers) throws IOException

Implements abstract com.fasterxml.jackson.databind.ser.std.StdSerializer.serialize.

Doc from com.fasterxml.jackson.databind.JsonSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

Parameters
value:Object

Value to serialize; can not be null.

g:JsonGenerator

Generator used to output resulting Json content

serializers:SerializerProvider

Provider that can be used to get serializers for serializing Objects value contains, if any.

Annotations
@Override
com.fasterxml.jackson.databind.ser.std back to summary

public Class StdKeySerializers.StringKeySerializer

extends StdSerializer<Object>
Class Inheritance

Deprecated

as a consequence of StdSerializer being deprecated. See corresponding docs for further information.

Simple and fast key serializer when keys are Strings.

Field Summary

Inherited from com.fasterxml.jackson.databind.ser.std.StdSerializer:
_handledType

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
serialize(Object
Value to serialize; can not be null.
value
,
JsonGenerator
Generator used to output resulting Json content
g
,
SerializerProvider
Provider that can be used to get serializers for serializing Objects value contains, if any.
provider
)

Implements abstract com.fasterxml.jackson.databind.ser.std.StdSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.
Inherited from com.fasterxml.jackson.databind.ser.std.StdSerializer:
_neitherNull_nonEmptyacceptJsonFormatVisitorcreateSchemaNodecreateSchemaNodefindAnnotatedContentSerializerfindContextualConvertingSerializerfindConvertingContentSerializerfindFormatFeaturefindFormatOverridesfindIncludeOverridesfindPropertyFiltergetSchemagetSchemahandledTypeisDefaultSerializervisitArrayFormatvisitArrayFormatvisitFloatFormatvisitIntFormatvisitIntFormatvisitStringFormatvisitStringFormatwrapAndThrowwrapAndThrow

Constructor Detail

StringKeySerializerback to summary
public StringKeySerializer()

Method Detail

serializeback to summary
public void serialize(Object value, JsonGenerator g, SerializerProvider provider) throws IOException

Implements abstract com.fasterxml.jackson.databind.ser.std.StdSerializer.serialize.

Doc from com.fasterxml.jackson.databind.JsonSerializer.serialize.

Method that can be called to ask implementation to serialize values of type this serializer handles.

Parameters
value:Object

Value to serialize; can not be null.

g:JsonGenerator

Generator used to output resulting Json content

provider:SerializerProvider

Provider that can be used to get serializers for serializing Objects value contains, if any.

Annotations
@Override