public class BeanSerializerFactory extends BasicSerializerFactory implements java.io.Serializable
Object.getClass()does not count); as well as for "standard" JDK types. Latter is achieved by delegating calls to
BasicSerializerFactoryto find serializers both for "standard" JDK types (and in some cases, sub-classes as is the case for collection classes like
Maps) and bean (value) classes.
Note about delegating calls to
although it would be nicer to use linear delegation
for construction (to essentially dispatch all calls first to the
BasicSerializerFactory; or alternatively after
failing to provide bean-based serializer}, there is a problem:
priority levels for detecting standard types are mixed. That is,
we want to check if a type is a bean after some of "standard" JDK
types, but before the rest.
As a result, "mixed" delegation used, and calls are NOT done using
SerializerFactory interface but rather via
direct calls to
Finally, since all caching is handled by the serializer provider (not factory) and there is no configurability, this factory is stateless. This means that a global singleton instance can be used.
|Modifier and Type||Field and Description|
|Modifier and Type||Method and Description|
Main serializer constructor method.
Method that will try to construct a
Method called to create a type information serializer for values of given container property if one is needed.
Method called to create a type information serializer for values of given non-container property if one is needed.
Method used by module registration functionality, to attach additional serializer providers into this serializer factory.
buildCollectionSerializer, buildEnumSetSerializer, buildIndexedListSerializer, createKeySerializer, createTypeSerializer, findReferenceSerializer, getFactoryConfig, withAdditionalKeySerializers, withAdditionalSerializers, withSerializerModifier
public SerializerFactory withConfig(SerializerFactoryConfig config)
public JsonSerializer<java.lang.Object> createSerializer(SerializerProvider prov, JavaType origType) throws JsonMappingException
Note: sub-classes may choose to complete replace implementation, if they want to alter priority of serializer lookups.
public JsonSerializer<java.lang.Object> findBeanSerializer(SerializerProvider prov, JavaType type, BeanDescription beanDesc) throws JsonMappingException
BeanSerializerfor given class. Returns null if no properties are found.
public TypeSerializer findPropertyTypeSerializer(JavaType baseType, SerializationConfig config, AnnotatedMember accessor) throws JsonMappingException
baseType- Declared type to use as the base type for type information serializer
public TypeSerializer findPropertyContentTypeSerializer(JavaType containerType, SerializationConfig config, AnnotatedMember accessor) throws JsonMappingException
containerType- Declared type of the container to use as the base type for type information serializer
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"