public abstract class SerializerFactory extends Object
SerializerProvider
to obtain actual
JsonSerializer
instances from multiple distinct factories.Modifier and Type | Class and Description |
---|---|
static class |
SerializerFactory.Config
Configuration settings container class for bean serializer factory.
|
Constructor and Description |
---|
SerializerFactory() |
Modifier and Type | Method and Description |
---|---|
abstract JsonSerializer<Object> |
createKeySerializer(SerializationConfig config,
JavaType baseType,
BeanProperty property)
Method called to create serializer to use for serializing JSON property names (which must
be output as
JsonToken.FIELD_NAME ) for Map that has specified declared
key type, and is for specified property (or, if property is null, as root value) |
JsonSerializer<Object> |
createSerializer(JavaType type,
SerializationConfig config)
Deprecated.
Since 1.7, call variant with more arguments
|
abstract JsonSerializer<Object> |
createSerializer(SerializationConfig config,
JavaType baseType,
BeanProperty property)
Method called to create (or, for immutable serializers, reuse) a serializer for given type.
|
TypeSerializer |
createTypeSerializer(JavaType baseType,
SerializationConfig config)
Deprecated.
Since 1.7, call variant with more arguments
|
abstract TypeSerializer |
createTypeSerializer(SerializationConfig config,
JavaType baseType,
BeanProperty property)
Method called to create a type information serializer for given base type,
if one is needed.
|
abstract SerializerFactory.Config |
getConfig() |
SerializerFactory |
withAdditionalKeySerializers(Serializers additional) |
SerializerFactory |
withAdditionalSerializers(Serializers additional)
Convenience method for creating a new factory instance with additional serializer
provider; equivalent to calling
|
abstract SerializerFactory |
withConfig(SerializerFactory.Config config)
Method used for creating a new instance of this factory, but with different
configuration.
|
SerializerFactory |
withSerializerModifier(BeanSerializerModifier modifier)
Convenience method for creating a new factory instance with additional bean
serializer modifier; equivalent to calling
|
public abstract SerializerFactory.Config getConfig()
public abstract SerializerFactory withConfig(SerializerFactory.Config config)
Note that custom sub-classes generally must override implementation
of this method, as it usually requires instantiating a new instance of
factory type. Check out javadocs for
BeanSerializerFactory
for more details.
public final SerializerFactory withAdditionalSerializers(Serializers additional)
withConfig(getConfig().withAdditionalSerializers(additional));
public final SerializerFactory withAdditionalKeySerializers(Serializers additional)
public final SerializerFactory withSerializerModifier(BeanSerializerModifier modifier)
withConfig(getConfig().withSerializerModifier(modifier));
public abstract JsonSerializer<Object> createSerializer(SerializationConfig config, JavaType baseType, BeanProperty property) throws JsonMappingException
JsonMappingException
public abstract TypeSerializer createTypeSerializer(SerializationConfig config, JavaType baseType, BeanProperty property) throws JsonMappingException
baseType
- Declared type to use as the base type for type information serializerJsonMappingException
public abstract JsonSerializer<Object> createKeySerializer(SerializationConfig config, JavaType baseType, BeanProperty property) throws JsonMappingException
JsonToken.FIELD_NAME
) for Map that has specified declared
key type, and is for specified property (or, if property is null, as root value)config
- Serialization configuration in usebaseType
- Declared type for Map keysproperty
- Property that contains Map being serialized; null when serializing root Map value.JsonMappingException
@Deprecated public final JsonSerializer<Object> createSerializer(JavaType type, SerializationConfig config)
@Deprecated public final TypeSerializer createTypeSerializer(JavaType baseType, SerializationConfig config)