java.util.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 | Field and Description |
|---|---|
| protected static final HashMap | _concrete
Since these are all JDK classes, we shouldn't have to worry about ClassLoader used to load them. |
| protected static final HashMap | _concreteLazy
Actually it may not make much sense to eagerly instantiate all kinds of serializers: so this Map actually contains class references, not instances |
| protected final SerializerFactoryConfig | _factoryConfig
Configuration settings for this factory; immutable instance (just like this factory), new version created via copy-constructor (fluent-style) |
| Access | Constructor and Description |
|---|---|
| protected | BasicSerializerFactory(SerializerFactoryConfig config)
We will provide default constructor to allow sub-classing, but make it protected so that no non-singleton instances of the class will be instantiated. |
| Modifier and Type | Method and Description |
|---|---|
| protected MapSerializer | _checkMapContentInclusion(SerializerProvider prov, BeanDescription beanDesc, MapSerializer mapSer)
References Deprecated
MapSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
Helper method that does figures out content inclusion value to use, if any,
and construct re-configured |
| protected JsonSerializer | _findContentSerializer(SerializerProvider prov, Annotated a)
Helper method called to try to find whether there is an annotation in the class that indicates content ("value") serializer to use. |
| protected JsonInclude. | _findInclusionWithContent(SerializerProvider prov, BeanDescription beanDesc, JavaType
Declared full content type of container contentType, Class<?> Raw base type under which `configOverride`, if any, needs to be defined configType)Helper method used for finding inclusion definitions for structured
container types like |
| protected JsonSerializer | _findKeySerializer(SerializerProvider prov, Annotated a)
Helper method called to try to find whether there is an annotation in the class that indicates key serializer to use. |
| private void | _removeEnumSelfReferences(BeanDescription
the bean description to remove Enum properties from. beanDesc)Helper method used for serialization |
| protected JsonSerializer | buildArraySerializer(SerializerProvider prov, ArrayType type, BeanDescription beanDesc, boolean staticTyping, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)
Helper method that handles configuration details when constructing serializers for
|
| protected JsonSerializer | buildAtomicReferenceSerializer(SerializerProvider prov, ReferenceType refType, BeanDescription beanDesc, boolean staticTyping, TypeSerializer contentTypeSerializer, JsonSerializer<Object> contentSerializer)
|
| protected JsonSerializer | buildCollectionSerializer(SerializerProvider prov, CollectionType type, BeanDescription beanDesc, boolean staticTyping, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)
Helper method that handles configuration details when constructing serializers for
|
| public ContainerSerializer | buildCollectionSerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, JsonSerializer<Object> valueSerializer)
References Deprecated
ContainerSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
|
| protected JsonSerializer | buildContainerSerializer(SerializerProvider prov, JavaType type, BeanDescription beanDesc, boolean staticTyping)
|
| protected JsonSerializer | |
| public JsonSerializer | |
| public ContainerSerializer | buildIndexedListSerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, JsonSerializer<Object> valueSerializer)
References Deprecated
ContainerSerializer is deprecated or references (maybe indirectly) at least one deprecated element.
|
| protected JsonSerializer | buildIterableSerializer(SerializationConfig config, JavaType type, BeanDescription beanDesc, boolean staticTyping, JavaType valueType)
|
| protected JsonSerializer | buildIteratorSerializer(SerializationConfig config, JavaType type, BeanDescription beanDesc, boolean staticTyping, JavaType valueType)
|
| protected JsonSerializer | buildMapEntrySerializer(SerializerProvider prov, JavaType type, BeanDescription beanDesc, boolean staticTyping, JavaType keyType, JavaType valueType)
|
| protected JsonSerializer | buildMapSerializer(SerializerProvider prov, MapType type, BeanDescription beanDesc, boolean staticTyping, JsonSerializer<Object> keySerializer, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)
Helper method that handles configuration details when constructing serializers for
|
| public JsonSerializer | createKeySerializer(SerializerProvider ctxt, JavaType
Declared type for Map keys keyType, JsonSerializer<Object> Default key serializer implementation to use, if no custom ones
are found (may be null) defaultImpl)Overrides com. Method called to create serializer to use for serializing JSON property names (which must
be output as |
| public JsonSerializer | createKeySerializer(SerializationConfig config, JavaType keyType, JsonSerializer<Object> defaultImpl)
Implements abstract com.
Deprecated
|
| public abstract JsonSerializer | createSerializer(SerializerProvider
Provider that needs to be used to resolve annotation-provided
serializers (but NOT for others) prov, JavaType type)Implements abstract com. Method called to create (or, for immutable serializers, reuse) a serializer for given type. |
| public TypeSerializer | createTypeSerializer(SerializationConfig config, JavaType
Declared type to use as the base type for type information serializer baseType)Implements abstract com. Method called to construct a type serializer for values with given declared base type. |
| protected abstract Iterable | |
| protected Converter | |
| protected JsonSerializer | findConvertingSerializer(SerializerProvider prov, Annotated a, JsonSerializer<?> ser)
Helper method that will check whether given annotated entity (usually class,
but may also be a property accessor) indicates that a |
| protected Object | findFilterId(SerializationConfig config, BeanDescription beanDesc)
Method called to find filter that is configured to be used with bean serializer being built, if any. |
| protected JsonSerializer | findOptionalStdSerializer(SerializerProvider prov, JavaType type, BeanDescription beanDesc, boolean staticTyping)
Overridable method called after checking all other types. |
| public JsonSerializer | findReferenceSerializer(SerializerProvider prov, ReferenceType refType, BeanDescription beanDesc, boolean staticTyping)
|
| protected final JsonSerializer | findSerializerByAddonType(SerializationConfig config, JavaType javaType, BeanDescription beanDesc, boolean staticTyping)
Reflection-based serialized find method, which checks if given class implements one of recognized "add-on" interfaces. |
| protected final JsonSerializer | findSerializerByAnnotations(SerializerProvider prov, JavaType type, BeanDescription beanDesc)
Method called to see if one of primary per-class annotations
(or related, like implementing of |
| protected final JsonSerializer | findSerializerByLookup(JavaType type, SerializationConfig config, BeanDescription beanDesc, boolean staticTyping)
Method that will use fast lookup (and identity comparison) methods to see if we know serializer to use for given type. |
| protected final JsonSerializer | findSerializerByPrimaryType(SerializerProvider prov, JavaType type, BeanDescription beanDesc, boolean staticTyping)
Method for checking if we can determine serializer to use based on set of
known primary types, checking for set of known base types (exact matches
having been compared against with |
| protected JsonSerializer | findSerializerFromAnnotation(SerializerProvider prov, Annotated a)
Helper method called to check if a class or method has an annotation (@link com.fasterxml.jackson.databind.annotation.JsonSerialize#using) that tells the class to use for serialization. |
| public SerializerFactoryConfig | |
| protected boolean | |
| protected boolean | usesStaticTyping(SerializationConfig config, BeanDescription beanDesc)
Helper method to check whether global settings and/or class annotations for the bean class indicate that static typing (declared types) should be used for properties. |
| public final SerializerFactory | withAdditionalKeySerializers(Serializers additional)
Implements abstract com. Convenience method for creating a new factory instance with an additional key serializer provider. |
| public final SerializerFactory | withAdditionalSerializers(Serializers additional)
Implements abstract com. Convenience method for creating a new factory instance with an additional serializer provider. |
| public abstract SerializerFactory | withConfig(SerializerFactoryConfig config)
Method used for creating a new instance of this factory, but with different configuration. |
| public final SerializerFactory | withSerializerModifier(BeanSerializerModifier modifier)
Implements abstract com. Convenience method for creating a new factory instance with additional bean serializer modifier. |
| _concrete | back to summary |
|---|---|
| protected static final HashMap<String, JsonSerializer<?>> _concrete Since these are all JDK classes, we shouldn't have to worry about ClassLoader used to load them. Rather, we can just use the class name, and keep things simple and efficient. | |
| _concreteLazy | back to summary |
|---|---|
| protected static final HashMap<String, Class<? extends JsonSerializer<?>>> _concreteLazy Actually it may not make much sense to eagerly instantiate all kinds of serializers: so this Map actually contains class references, not instances | |
| _factoryConfig | back to summary |
|---|---|
| protected final SerializerFactoryConfig _factoryConfig Configuration settings for this factory; immutable instance (just like this factory), new version created via copy-constructor (fluent-style) | |
| BasicSerializerFactory | back to summary |
|---|---|
| protected BasicSerializerFactory(SerializerFactoryConfig config) We will provide default constructor to allow sub-classing, but make it protected so that no non-singleton instances of the class will be instantiated. | |
| _checkMapContentInclusion | back to summary |
|---|---|
| protected MapSerializer _checkMapContentInclusion(SerializerProvider prov, BeanDescription beanDesc, MapSerializer mapSer) throws JsonMappingException
References Deprecated
See corresponding docs for further information. Helper method that does figures out content inclusion value to use, if any,
and construct re-configured
| |
| _findContentSerializer | back to summary |
|---|---|
| protected JsonSerializer Helper method called to try to find whether there is an annotation in the class that indicates content ("value") serializer to use. If so, will try to instantiate value serializer and return it; otherwise returns null. | |
| _findInclusionWithContent | back to summary |
|---|---|
| protected JsonInclude. Helper method used for finding inclusion definitions for structured
container types like | |
| _findKeySerializer | back to summary |
|---|---|
| protected JsonSerializer Helper method called to try to find whether there is an annotation in the class that indicates key serializer to use. If so, will try to instantiate key serializer and return it; otherwise returns null. | |
| _removeEnumSelfReferences | back to summary |
|---|---|
| private void _removeEnumSelfReferences(BeanDescription beanDesc) Helper method used for serialization
Internally, this method iterates through
| |
| buildArraySerializer | back to summary |
|---|---|
| protected JsonSerializer Helper method that handles configuration details when constructing serializers for
| |
| buildAtomicReferenceSerializer | back to summary |
|---|---|
| protected JsonSerializer | |
| buildCollectionSerializer | back to summary |
|---|---|
| protected JsonSerializer Helper method that handles configuration details when constructing serializers for
| |
| buildCollectionSerializer | back to summary |
|---|---|
| public ContainerSerializer References Deprecated
See corresponding docs for further information. | |
| buildContainerSerializer | back to summary |
|---|---|
protected JsonSerializer
| |
| buildEnumSerializer | back to summary |
|---|---|
| protected JsonSerializer | |
| buildEnumSetSerializer | back to summary |
|---|---|
| public JsonSerializer | |
| buildIndexedListSerializer | back to summary |
|---|---|
| public ContainerSerializer References Deprecated
See corresponding docs for further information. | |
| buildIterableSerializer | back to summary |
|---|---|
protected JsonSerializer
| |
| buildIteratorSerializer | back to summary |
|---|---|
protected JsonSerializer
| |
| buildMapEntrySerializer | back to summary |
|---|---|
protected JsonSerializer
| |
| buildMapSerializer | back to summary |
|---|---|
| protected JsonSerializer Helper method that handles configuration details when constructing serializers for
| |
| createKeySerializer | back to summary |
|---|---|
| public JsonSerializer Overrides com. Doc from com. Method called to create serializer to use for serializing JSON property names (which must
be output as
| |
| createKeySerializer | back to summary |
|---|---|
| public JsonSerializer Implements abstract com. Deprecated
| |
| createSerializer | back to summary |
|---|---|
| public abstract JsonSerializer Implements abstract com. Doc from com. Method called to create (or, for immutable serializers, reuse) a serializer for given type.
| |
| createTypeSerializer | back to summary |
|---|---|
| public TypeSerializer createTypeSerializer(SerializationConfig config, JavaType baseType) Implements abstract com. Method called to construct a type serializer for values with given declared base type. This is called for values other than those of bean property types.
| |
| customSerializers | back to summary |
|---|---|
| protected abstract Iterable | |
| findConverter | back to summary |
|---|---|
| protected Converter | |
| findConvertingSerializer | back to summary |
|---|---|
| protected JsonSerializer Helper method that will check whether given annotated entity (usually class,
but may also be a property accessor) indicates that a | |
| findFilterId | back to summary |
|---|---|
| protected Object findFilterId(SerializationConfig config, BeanDescription beanDesc) Method called to find filter that is configured to be used with bean serializer being built, if any. | |
| findOptionalStdSerializer | back to summary |
|---|---|
| protected JsonSerializer Overridable method called after checking all other types.
| |
| findReferenceSerializer | back to summary |
|---|---|
public JsonSerializer
| |
| findSerializerByAddonType | back to summary |
|---|---|
| protected final JsonSerializer Reflection-based serialized find method, which checks if
given class implements one of recognized "add-on" interfaces.
Add-on here means a role that is usually or can be a secondary
trait: for example,
bean classes may implement | |
| findSerializerByAnnotations | back to summary |
|---|---|
| protected final JsonSerializer Method called to see if one of primary per-class annotations
(or related, like implementing of Currently handles things like:
| |
| findSerializerByLookup | back to summary |
|---|---|
| protected final JsonSerializer Method that will use fast lookup (and identity comparison) methods to see if we know serializer to use for given type. | |
| findSerializerByPrimaryType | back to summary |
|---|---|
| protected final JsonSerializer Method for checking if we can determine serializer to use based on set of
known primary types, checking for set of known base types (exact matches
having been compared against with | |
| findSerializerFromAnnotation | back to summary |
|---|---|
| protected JsonSerializer Helper method called to check if a class or method has an annotation (@link com.fasterxml.jackson.databind.annotation.JsonSerialize#using) that tells the class to use for serialization. Returns null if no such annotation found.
| |
| getFactoryConfig | back to summary |
|---|---|
| public SerializerFactoryConfig getFactoryConfig() Method for getting current 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. | |
| isIndexedList | back to summary |
|---|---|
| protected boolean isIndexedList(Class<?> cls) | |
| usesStaticTyping | back to summary |
|---|---|
| protected boolean usesStaticTyping(SerializationConfig config, BeanDescription beanDesc) Helper method to check whether global settings and/or class annotations for the bean class indicate that static typing (declared types) should be used for properties. (instead of dynamic runtime types).
| |
| withAdditionalKeySerializers | back to summary |
|---|---|
| public final SerializerFactory withAdditionalKeySerializers(Serializers additional) Implements abstract com. Convenience method for creating a new factory instance with an additional key serializer provider.
| |
| withAdditionalSerializers | back to summary |
|---|---|
| public final SerializerFactory withAdditionalSerializers(Serializers additional) Implements abstract com. Convenience method for creating a new factory instance with an additional serializer provider.
| |
| withConfig | back to summary |
|---|---|
| public abstract SerializerFactory withConfig(SerializerFactoryConfig config) Method used for creating a new instance of this factory, but with different configuration. Reason for specifying factory method (instead of plain constructor) is to allow proper sub-classing of factories.
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
| |
| withSerializerModifier | back to summary |
|---|---|
| public final SerializerFactory withSerializerModifier(BeanSerializerModifier modifier) Implements abstract com. Convenience method for creating a new factory instance with additional bean serializer modifier.
| |