public abstract class DefaultSerializerProvider extends SerializerProvider implements Serializable
ObjectMapper:
 adds methods only exposed to ObjectMapper,
 as well as constructors.
 Note that class is abstract just because it does not
 define createInstance(com.fasterxml.jackson.databind.SerializationConfig, com.fasterxml.jackson.databind.ser.SerializerFactory) method.
 Also note that all custom SerializerProvider
 implementations must sub-class this class: ObjectMapper
 requires this type, not basic provider type.
| Modifier and Type | Class and Description | 
|---|---|
| static class  | DefaultSerializerProvider.ImplConcrete implementation that defines factory method(s),
 defined as final. | 
| Modifier and Type | Field and Description | 
|---|---|
| protected ArrayList<com.fasterxml.jackson.annotation.ObjectIdGenerator<?>> | _objectIdGenerators | 
| protected Map<Object,WritableObjectId> | _seenObjectIdsPer-serialization map Object Ids that have seen so far, iff
 Object Id handling is enabled. | 
_attributes, _config, _dateFormat, _keySerializer, _knownSerializers, _nullKeySerializer, _nullValueSerializer, _rootNames, _serializationView, _serializerCache, _serializerFactory, _stdNullValueSerializer, _unknownTypeSerializer, CACHE_UNKNOWN_MAPPINGS, DEFAULT_NULL_KEY_SERIALIZER, DEFAULT_UNKNOWN_SERIALIZER| Modifier | Constructor and Description | 
|---|---|
| protected  | DefaultSerializerProvider() | 
| protected  | DefaultSerializerProvider(DefaultSerializerProvider src) | 
| protected  | DefaultSerializerProvider(SerializerProvider src,
                         SerializationConfig config,
                         SerializerFactory f) | 
| Modifier and Type | Method and Description | 
|---|---|
| protected Map<Object,WritableObjectId> | _createObjectIdMap()Overridable helper method used for creating  Mapused for storing mappings from serializable objects to their
 Object Ids. | 
| protected void | _serializeNull(com.fasterxml.jackson.core.JsonGenerator gen)Helper method called when root value to serialize is null | 
| void | acceptJsonFormatVisitor(JavaType javaType,
                       JsonFormatVisitorWrapper visitor)The method to be called by  ObjectMapperandObjectWriterto to expose the format of the given to to the given visitor | 
| int | cachedSerializersCount()Method that can be used to determine how many serializers this
 provider is caching currently
 (if it does caching: default implementation does)
 Exact count depends on what kind of serializers get cached;
 default implementation caches all serializers, including ones that
 are eagerly constructed (for optimal access speed) | 
| DefaultSerializerProvider | copy()Method needed to ensure that  ObjectMapper.copy()will work
 properly; specifically, that caches are cleared, but settings
 will otherwise remain identical; and that no sharing of state
 occurs. | 
| abstract DefaultSerializerProvider | createInstance(SerializationConfig config,
              SerializerFactory jsf)Overridable method, used to create a non-blueprint instances from the blueprint. | 
| WritableObjectId | findObjectId(Object forPojo,
            com.fasterxml.jackson.annotation.ObjectIdGenerator<?> generatorType)Method called to find the Object Id for given POJO, if one
 has been generated. | 
| void | flushCachedSerializers()Method that will drop all serializers currently cached by this provider. | 
| JsonSchema | generateJsonSchema(Class<?> type) | 
| boolean | hasSerializerFor(Class<?> cls,
                AtomicReference<Throwable> cause)Method that can be called to see if this serializer provider
 can find a serializer for an instance of given class. | 
| void | serializePolymorphic(com.fasterxml.jackson.core.JsonGenerator gen,
                    Object value,
                    TypeSerializer typeSer)Alternate serialization call used for polymorphic types, when  TypeSerializeris already known, but not actual value serializer. | 
| JsonSerializer<Object> | serializerInstance(Annotated annotated,
                  Object serDef)Method that can be called to construct and configure serializer instance,
 either given a  Classto instantiate (with default constructor),
 or an uninitialized serializer instance. | 
| void | serializeValue(com.fasterxml.jackson.core.JsonGenerator gen,
              Object value)The method to be called by  ObjectMapperandObjectWriterfor serializing given value, using serializers that
 this provider has access to (via caching and/or creating new serializers
 as need be). | 
| void | serializeValue(com.fasterxml.jackson.core.JsonGenerator gen,
              Object value,
              JavaType rootType)The method to be called by  ObjectMapperandObjectWriterfor serializing given value (assumed to be of specified root type,
 instead of runtime type of value),
 using serializers that
 this provider has access to (via caching and/or creating new serializers
 as need be), | 
| void | serializeValue(com.fasterxml.jackson.core.JsonGenerator gen,
              Object value,
              JavaType rootType,
              JsonSerializer<Object> ser)The method to be called by  ObjectWriterfor serializing given value (assumed to be of specified root type,
 instead of runtime type of value), when it may know specificJsonSerializerto use. | 
_createAndCacheUntypedSerializer, _createAndCacheUntypedSerializer, _createUntypedSerializer, _dateFormat, _findExplicitUntypedSerializer, _handleContextualResolvable, _handleResolvable, _reportIncompatibleRootType, defaultSerializeDateKey, defaultSerializeDateKey, defaultSerializeDateValue, defaultSerializeDateValue, defaultSerializeField, defaultSerializeNull, defaultSerializeValue, findKeySerializer, findNullKeySerializer, findNullValueSerializer, findPrimaryPropertySerializer, findPrimaryPropertySerializer, findTypedValueSerializer, findTypedValueSerializer, findValueSerializer, findValueSerializer, findValueSerializer, findValueSerializer, getActiveView, getAnnotationIntrospector, getAttribute, getConfig, getDefaultNullKeySerializer, getDefaultNullValueSerializer, getFilterProvider, getLocale, getSerializationView, getTimeZone, getTypeFactory, getUnknownTypeSerializer, handlePrimaryContextualization, handleSecondaryContextualization, hasSerializationFeatures, isEnabled, isUnknownTypeSerializer, setAttribute, setDefaultKeySerializer, setNullKeySerializer, setNullValueSerializercanOverrideAccessModifiers, constructSpecializedType, constructType, converterInstance, isEnabled, objectIdGeneratorInstance, objectIdResolverInstanceprotected transient Map<Object,WritableObjectId> _seenObjectIds
protected transient ArrayList<com.fasterxml.jackson.annotation.ObjectIdGenerator<?>> _objectIdGenerators
protected DefaultSerializerProvider()
protected DefaultSerializerProvider(SerializerProvider src, SerializationConfig config, SerializerFactory f)
protected DefaultSerializerProvider(DefaultSerializerProvider src)
public DefaultSerializerProvider copy()
ObjectMapper.copy() will work
 properly; specifically, that caches are cleared, but settings
 will otherwise remain identical; and that no sharing of state
 occurs.public abstract DefaultSerializerProvider createInstance(SerializationConfig config, SerializerFactory jsf)
public void serializeValue(com.fasterxml.jackson.core.JsonGenerator gen,
                  Object value)
                    throws IOException
ObjectMapper and ObjectWriter
 for serializing given value, using serializers that
 this provider has access to (via caching and/or creating new serializers
 as need be).IOExceptionpublic void serializeValue(com.fasterxml.jackson.core.JsonGenerator gen,
                  Object value,
                  JavaType rootType)
                    throws IOException
ObjectMapper and ObjectWriter
 for serializing given value (assumed to be of specified root type,
 instead of runtime type of value),
 using serializers that
 this provider has access to (via caching and/or creating new serializers
 as need be),rootType - Type to use for locating serializer to use, instead of actual
    runtime type. Must be actual type, or one of its super typesIOExceptionpublic void serializeValue(com.fasterxml.jackson.core.JsonGenerator gen,
                  Object value,
                  JavaType rootType,
                  JsonSerializer<Object> ser)
                    throws IOException
ObjectWriter
 for serializing given value (assumed to be of specified root type,
 instead of runtime type of value), when it may know specific
 JsonSerializer to use.rootType - Type to use for locating serializer to use, instead of actual
    runtime type, if no serializer is passedser - Root Serializer to use, if not nullIOExceptionpublic void serializePolymorphic(com.fasterxml.jackson.core.JsonGenerator gen,
                        Object value,
                        TypeSerializer typeSer)
                          throws IOException
TypeSerializer
 is already known, but not actual value serializer.IOExceptionprotected void _serializeNull(com.fasterxml.jackson.core.JsonGenerator gen)
                       throws IOException
IOExceptionpublic JsonSchema generateJsonSchema(Class<?> type) throws JsonMappingException
type - The type for which to generate schemaJsonMappingExceptionpublic void acceptJsonFormatVisitor(JavaType javaType, JsonFormatVisitorWrapper visitor) throws JsonMappingException
ObjectMapper and ObjectWriter
 to to expose the format of the given to to the given visitorjavaType - The type for which to generate formatvisitor - the visitor to accept the formatJsonMappingExceptionpublic boolean hasSerializerFor(Class<?> cls, AtomicReference<Throwable> cause)
Note that no Exceptions are thrown, including unchecked ones: implementations are to swallow exceptions if necessary.
public int cachedSerializersCount()
The main use case for this method is to allow conditional flushing of serializer cache, if certain number of entries is reached.
public void flushCachedSerializers()
public WritableObjectId findObjectId(Object forPojo, com.fasterxml.jackson.annotation.ObjectIdGenerator<?> generatorType)
SerializerProviderfindObjectId in class SerializerProviderprotected Map<Object,WritableObjectId> _createObjectIdMap()
Map
 used for storing mappings from serializable objects to their
 Object Ids.public JsonSerializer<Object> serializerInstance(Annotated annotated, Object serDef) throws JsonMappingException
SerializerProviderClass to instantiate (with default constructor),
 or an uninitialized serializer instance.
 Either way, serialize will be properly resolved
 (via ResolvableSerializer) and/or contextualized
 (via ContextualSerializer) as necessary.serializerInstance in class SerializerProviderannotated - Annotated entity that contained definitionserDef - Serializer definition: either an instance or classJsonMappingExceptionCopyright © 2014-2015 FasterXML. All Rights Reserved.