public abstract class SerializerFactory extends Object
SerializerProvider
to obtain actual
JsonSerializer
instances from multiple distinct factories.Constructor and Description |
---|
SerializerFactory() |
Modifier and Type | Method and Description |
---|---|
JsonSerializer<Object> |
createKeySerializer(SerializationConfig config,
JavaType baseType)
Deprecated.
Since 2.2, use one that takes additional
defaultImpl parameter |
abstract JsonSerializer<Object> |
createKeySerializer(SerializationConfig config,
JavaType baseType,
JsonSerializer<Object> defaultImpl)
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) |
abstract JsonSerializer<Object> |
createSerializer(SerializerProvider prov,
JavaType baseType)
Method called to create (or, for immutable serializers, reuse) a serializer for given type.
|
JsonSerializer<Object> |
createSerializer(SerializerProvider prov,
JavaType baseType,
BeanProperty property)
Deprecated.
Since 2.1: need to use the new variant without 'property'
argument (since one won't be passed)
|
abstract TypeSerializer |
createTypeSerializer(SerializationConfig config,
JavaType baseType)
Method called to create a type information serializer for given base type,
if one is needed.
|
abstract SerializerFactory |
withAdditionalKeySerializers(Serializers additional) |
abstract SerializerFactory |
withAdditionalSerializers(Serializers additional)
Convenience method for creating a new factory instance with additional serializer
provider; equivalent to calling
|
abstract SerializerFactory |
withSerializerModifier(BeanSerializerModifier modifier)
Convenience method for creating a new factory instance with additional bean
serializer modifier; equivalent to calling
|
public abstract SerializerFactory withAdditionalSerializers(Serializers additional)
withConfig(getConfig().withAdditionalSerializers(additional));
public abstract SerializerFactory withAdditionalKeySerializers(Serializers additional)
public abstract SerializerFactory withSerializerModifier(BeanSerializerModifier modifier)
withConfig(getConfig().withSerializerModifier(modifier));
@Deprecated public JsonSerializer<Object> createSerializer(SerializerProvider prov, JavaType baseType, BeanProperty property) throws JsonMappingException
JsonMappingException
public abstract JsonSerializer<Object> createSerializer(SerializerProvider prov, JavaType baseType) throws JsonMappingException
prov
- Provider that needs to be used to resolve annotation-provided
serializers (but NOT for others)JsonMappingException
public abstract TypeSerializer createTypeSerializer(SerializationConfig config, JavaType baseType) throws JsonMappingException
baseType
- Declared type to use as the base type for type information serializerJsonMappingException
public abstract JsonSerializer<Object> createKeySerializer(SerializationConfig config, JavaType baseType, JsonSerializer<Object> defaultImpl) 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)baseType
- Declared type for Map keysdefaultImpl
- Default key serializer implementation to use, if no custom ones
are found (may be null)JsonMappingException
@Deprecated public JsonSerializer<Object> createKeySerializer(SerializationConfig config, JavaType baseType) throws JsonMappingException
defaultImpl
parameterJsonMappingException
Copyright © 2012-2013 FasterXML. All Rights Reserved.