public abstract class BasicSerializerFactory extends SerializerFactory implements java.io.Serializable
Collection
).
Since all the serializers are eagerly instantiated, and there is no additional introspection or customizability of these types, this factory is essentially stateless.
Modifier and Type | Method and Description |
---|---|
ContainerSerializer<?> |
buildCollectionSerializer(JavaType elemType,
boolean staticTyping,
TypeSerializer vts,
JsonSerializer<java.lang.Object> valueSerializer) |
JsonSerializer<?> |
buildEnumSetSerializer(JavaType enumType) |
ContainerSerializer<?> |
buildIndexedListSerializer(JavaType elemType,
boolean staticTyping,
TypeSerializer vts,
JsonSerializer<java.lang.Object> valueSerializer) |
JsonSerializer<java.lang.Object> |
createKeySerializer(SerializationConfig config,
JavaType keyType,
JsonSerializer<java.lang.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<java.lang.Object> |
createSerializer(SerializerProvider prov,
JavaType type)
Method called to create (or, for immutable serializers, reuse) a serializer for given type.
|
TypeSerializer |
createTypeSerializer(SerializationConfig config,
JavaType baseType)
Method called to construct a type serializer for values with given declared
base type.
|
JsonSerializer<?> |
findReferenceSerializer(SerializerProvider prov,
ReferenceType refType,
BeanDescription beanDesc,
boolean staticTyping) |
SerializerFactoryConfig |
getFactoryConfig()
Method for getting current
SerializerFactoryConfig . |
SerializerFactory |
withAdditionalKeySerializers(Serializers additional)
Convenience method for creating a new factory instance with an additional
key serializer provider.
|
SerializerFactory |
withAdditionalSerializers(Serializers additional)
Convenience method for creating a new factory instance with an additional
serializer provider.
|
abstract SerializerFactory |
withConfig(SerializerFactoryConfig 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.
|
public SerializerFactoryConfig getFactoryConfig()
SerializerFactoryConfig
.
Note that since instances are immutable, you can NOT change settings by accessing an instance and calling methods: this will simply create new instance of config object.
public abstract SerializerFactory withConfig(SerializerFactoryConfig 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)
withAdditionalSerializers
in class SerializerFactory
public final SerializerFactory withAdditionalKeySerializers(Serializers additional)
withAdditionalKeySerializers
in class SerializerFactory
public final SerializerFactory withSerializerModifier(BeanSerializerModifier modifier)
withSerializerModifier
in class SerializerFactory
public abstract JsonSerializer<java.lang.Object> createSerializer(SerializerProvider prov, JavaType type) throws JsonMappingException
SerializerFactory
createSerializer
in class SerializerFactory
prov
- Provider that needs to be used to resolve annotation-provided
serializers (but NOT for others)JsonMappingException
public JsonSerializer<java.lang.Object> createKeySerializer(SerializationConfig config, JavaType keyType, JsonSerializer<java.lang.Object> defaultImpl)
SerializerFactory
JsonToken.FIELD_NAME
) for Map that has specified declared
key type, and is for specified property (or, if property is null, as root value)createKeySerializer
in class SerializerFactory
keyType
- Declared type for Map keysdefaultImpl
- Default key serializer implementation to use, if no custom ones
are found (may be null)public TypeSerializer createTypeSerializer(SerializationConfig config, JavaType baseType)
createTypeSerializer
in class SerializerFactory
baseType
- Declared type to use as the base type for type information serializerpublic ContainerSerializer<?> buildIndexedListSerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, JsonSerializer<java.lang.Object> valueSerializer)
public ContainerSerializer<?> buildCollectionSerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, JsonSerializer<java.lang.Object> valueSerializer)
public JsonSerializer<?> buildEnumSetSerializer(JavaType enumType)
public JsonSerializer<?> findReferenceSerializer(SerializerProvider prov, ReferenceType refType, BeanDescription beanDesc, boolean staticTyping) throws JsonMappingException
JsonMappingException
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"