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 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 ValueSerializer | _buildReferenceSerializer(SerializationContext ctxt, Class<?> baseType, ReferenceType refType, BeanDescription.
|
| protected JsonFormat. | _calculateEffectiveFormat(SerializationContext ctxt, BeanDescription.
Helper method that will combine all available pieces of format configuration and calculate effective format settings to use. |
| protected MapSerializer | _checkMapContentInclusion(SerializationContext ctxt, BeanDescription.
Helper method that does figures out content inclusion value to use, if any,
and construct re-configured |
| protected ValueSerializer | _findContentSerializer(SerializationContext ctxt, 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(SerializationContext ctxt, BeanDescription.
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 ValueSerializer | _findKeySerializer(SerializationContext ctxt, 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 ValueSerializer | buildArraySerializer(SerializationContext ctxt, ArrayType type, BeanDescription.
Helper method that handles configuration details when constructing serializers for
|
| protected ValueSerializer | buildCollectionSerializer(SerializationContext ctxt, CollectionType type, BeanDescription.
Helper method that handles configuration details when constructing serializers for
|
| public StdContainerSerializer | buildCollectionSerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, ValueSerializer<Object> valueSerializer)
|
| protected ValueSerializer | buildContainerSerializer(SerializationContext ctxt, JavaType type, BeanDescription.
|
| protected ValueSerializer | buildEnumSerializer(SerializationContext ctxt, JavaType type, BeanDescription.
|
| public ValueSerializer | |
| public StdContainerSerializer | buildIndexedListSerializer(JavaType elemType, boolean staticTyping, TypeSerializer vts, ValueSerializer<Object> valueSerializer)
|
| protected ValueSerializer | buildIterableSerializer(SerializationContext ctxt, JavaType type, BeanDescription.
|
| protected ValueSerializer | buildIteratorSerializer(SerializationContext ctxt, JavaType type, BeanDescription.
|
| protected ValueSerializer | buildMapEntrySerializer(SerializationContext ctxt, JavaType type, BeanDescription.
|
| protected ValueSerializer | buildMapSerializer(SerializationContext ctxt, MapType type, BeanDescription.
Helper method that handles configuration details when constructing serializers for
|
| public ValueSerializer | createKeySerializer(SerializationContext ctxt, JavaType keyType)
Implements abstract tools. Method called to create serializer to use for serializing JSON property names (which must
be output as |
| protected Iterable | |
| protected Converter | |
| protected ValueSerializer | findConvertingSerializer(SerializationContext ctxt, Annotated a, ValueSerializer<?> 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.
Method called to find filter that is configured to be used with bean serializer being built, if any. |
| public TypeSerializer | Returns: Type serializer to use for property value contents, if one is needed; null if not.Declared type of the container to use as the base type for type information serializer containerType, AnnotatedMember accessor)Method called to create a type information serializer for values of given container property if one is needed. |
| public ValueSerializer | findReferenceSerializer(SerializationContext ctxt, ReferenceType refType, BeanDescription.
|
| protected final ValueSerializer | findSerializerByAddonType(SerializationContext ctxt, JavaType javaType, BeanDescription.
Reflection-based serialized find method, which checks if given class implements one of recognized "add-on" interfaces. |
| protected final ValueSerializer | findSerializerByAnnotations(SerializationContext ctxt, JavaType type, BeanDescription.
Method called to see if one of primary per-class annotations
(or related, like implementing of |
| protected final ValueSerializer | findSerializerByPrimaryType(SerializationContext ctxt, JavaType type, BeanDescription.
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 ValueSerializer | findSerializerFromAnnotation(SerializationContext ctxt, Annotated a)
Helper method called to check if a class or method has an annotation (@link tools.jackson.databind.annotation.JsonSerialize#using) that tells the class to use for serialization. |
| public ValueSerializer | getDefaultNullKeySerializer()
Implements abstract tools. Returns serializer used to (try to) output a null key, due to an entry of
|
| public ValueSerializer | |
| protected boolean | |
| protected boolean | usesStaticTyping(SerializationConfig config, BeanDescription.
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 tools. Convenience method for creating a new factory instance with an additional key serializer provider. |
| public final SerializerFactory | withAdditionalSerializers(Serializers additional)
Implements abstract tools. Convenience method for creating a new factory instance with an additional serializer provider. |
| protected abstract SerializerFactory | withConfig(SerializerFactoryConfig config)
Method used for creating a new instance of this factory, but with different configuration. |
| public final SerializerFactory | withNullKeySerializer(ValueSerializer<?> nks)
Implements abstract tools.
|
| public final SerializerFactory | withNullValueSerializer(ValueSerializer<?> nvs)
Implements abstract tools.
|
| public final SerializerFactory | withSerializerModifier(ValueSerializerModifier modifier)
Implements abstract tools. Convenience method for creating a new factory instance with additional bean serializer modifier. |
| _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. | |
| _buildReferenceSerializer | back to summary |
|---|---|
| protected ValueSerializer | |
| _calculateEffectiveFormat | back to summary |
|---|---|
| protected JsonFormat. Helper method that will combine all available pieces of format configuration and calculate effective format settings to use.
| |
| _checkMapContentInclusion | back to summary |
|---|---|
| protected MapSerializer _checkMapContentInclusion(SerializationContext ctxt, BeanDescription. Helper method that does figures out content inclusion value to use, if any,
and construct re-configured | |
| _findContentSerializer | back to summary |
|---|---|
| protected ValueSerializer 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 ValueSerializer 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 ValueSerializer Helper method that handles configuration details when constructing serializers for
| |
| buildCollectionSerializer | back to summary |
|---|---|
| protected ValueSerializer Helper method that handles configuration details when constructing serializers for
| |
| buildCollectionSerializer | back to summary |
|---|---|
| public StdContainerSerializer | |
| buildContainerSerializer | back to summary |
|---|---|
| protected ValueSerializer | |
| buildEnumSerializer | back to summary |
|---|---|
| protected ValueSerializer | |
| buildEnumSetSerializer | back to summary |
|---|---|
| public ValueSerializer | |
| buildIndexedListSerializer | back to summary |
|---|---|
| public StdContainerSerializer | |
| buildIterableSerializer | back to summary |
|---|---|
| protected ValueSerializer | |
| buildIteratorSerializer | back to summary |
|---|---|
| protected ValueSerializer | |
| buildMapEntrySerializer | back to summary |
|---|---|
| protected ValueSerializer | |
| buildMapSerializer | back to summary |
|---|---|
| protected ValueSerializer Helper method that handles configuration details when constructing serializers for
| |
| createKeySerializer | back to summary |
|---|---|
| public ValueSerializer Implements abstract tools. Doc from tools. Method called to create serializer to use for serializing JSON property names (which must
be output as
| |
| customSerializers | back to summary |
|---|---|
| protected Iterable | |
| findConverter | back to summary |
|---|---|
| protected Converter | |
| findConvertingSerializer | back to summary |
|---|---|
| protected ValueSerializer 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. Method called to find filter that is configured to be used with bean serializer being built, if any. | |
| findPropertyContentTypeSerializer | back to summary |
|---|---|
| public TypeSerializer findPropertyContentTypeSerializer(SerializationContext ctxt, JavaType containerType, AnnotatedMember accessor) Method called to create a type information serializer for values of given container property if one is needed. If not needed (no polymorphic handling configured), should return null.
| |
| findReferenceSerializer | back to summary |
|---|---|
| public ValueSerializer | |
| findSerializerByAddonType | back to summary |
|---|---|
| protected final ValueSerializer 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 ValueSerializer Method called to see if one of primary per-class annotations
(or related, like implementing of Currently handles things like:
| |
| findSerializerByPrimaryType | back to summary |
|---|---|
| protected final ValueSerializer 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 ValueSerializer Helper method called to check if a class or method has an annotation (@link tools.jackson.databind.annotation.JsonSerialize#using) that tells the class to use for serialization. Returns null if no such annotation found.
| |
| getDefaultNullKeySerializer | back to summary |
|---|---|
| public ValueSerializer Implements abstract tools. Doc from tools. Returns serializer used to (try to) output a null key, due to an entry of
| |
| getDefaultNullValueSerializer | back to summary |
|---|---|
| public ValueSerializer Implements abstract tools.
| |
| isIndexedList | back to summary |
|---|---|
| protected boolean isIndexedList(Class<?> cls) | |
| usesStaticTyping | back to summary |
|---|---|
| protected boolean usesStaticTyping(SerializationConfig config, BeanDescription. 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 tools. 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 tools. Convenience method for creating a new factory instance with an additional serializer provider.
| |
| withConfig | back to summary |
|---|---|
| protected 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
| |
| withNullKeySerializer | back to summary |
|---|---|
| public final SerializerFactory withNullKeySerializer(ValueSerializer<?> nks) Implements abstract tools.
| |
| withNullValueSerializer | back to summary |
|---|---|
| public final SerializerFactory withNullValueSerializer(ValueSerializer<?> nvs) Implements abstract tools.
| |
| withSerializerModifier | back to summary |
|---|---|
| public final SerializerFactory withSerializerModifier(ValueSerializerModifier modifier) Implements abstract tools. Convenience method for creating a new factory instance with additional bean serializer modifier.
| |