ObjectMapper:
adds methods only exposed to ObjectMapper,
as well as constructors.
Note that class is abstract just because it does not
define createInstance 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 |
|---|---|
| public static class | DefaultSerializerProvider.
Concrete implementation that defines factory method(s), defined as final. |
| Modifier and Type | Field and Description |
|---|---|
| protected transient JsonGenerator | _generator
Generator used for serialization. |
| protected transient ArrayList | |
| protected transient Map | _seenObjectIds
Per-serialization map Object Ids that have seen so far, iff Object Id handling is enabled. |
| private static final long |
| Access | Constructor and Description |
|---|---|
| protected | |
| protected | |
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected Map | _createObjectIdMap()
Overridable helper method used for creating |
| private final void | |
| private final void | |
| protected void | |
| private IOException | |
| public void | acceptJsonFormatVisitor(JavaType
The type for which to generate format javaType, JsonFormatVisitorWrapper the visitor to accept the format visitor)The method to be called by |
| public 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) The main use case for this method is to allow conditional flushing of serializer cache, if certain number of entries is reached. |
| public DefaultSerializerProvider | copy()
Method needed to ensure that |
| public abstract DefaultSerializerProvider | createInstance(SerializationConfig config, SerializerFactory jsf)
Method that sub-classes need to implement: used to create a non-blueprint instances from the blueprint. |
| public WritableObjectId | findObjectId(Object forPojo, ObjectIdGenerator<?> generatorType)
Implements abstract com. Method called to find the Object Id for given POJO, if one has been generated. |
| public void | |
| public JsonSchema | generateJsonSchema(Class<?>
The type for which to generate schema type)
Deprecated
Should not be used any more
The method to be called by |
| public JsonGenerator | getGenerator()
Overrides com. Accessor for the |
| public 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. |
| public Object | includeFilterInstance(BeanPropertyDefinition
(optional) If filter is created for a property, that property;
`null` if filter created via defaulting, global or per-type. forProperty, Class<?> filterClass)Implements abstract com. Method that can be called to construct and configure |
| public boolean | includeFilterSuppressNulls(Object filter)
Implements abstract com. Follow-up method that may be called after calling |
| public void | serializePolymorphic(JsonGenerator gen, Object value, JavaType rootType, JsonSerializer<Object> valueSer, TypeSerializer typeSer)
Alternate serialization call used for polymorphic types, when |
| public JsonSerializer | serializerInstance(Annotated
Annotated entity that contained definition annotated, Object Serializer definition: either an instance or class serDef)Implements abstract com. Method that can be called to construct and configure serializer instance,
either given a |
| public void | serializeValue(JsonGenerator gen, Object value)
The method to be called by |
| public void | serializeValue(JsonGenerator gen, Object value, JavaType
Type to use for locating serializer to use, instead of actual
runtime type. Must be actual type, or one of its super types rootType)The method to be called by |
| public void | serializeValue(JsonGenerator gen, Object value, JavaType
Type to use for locating serializer to use, instead of actual
runtime type, if no serializer is passed rootType, JsonSerializer<Object> Root Serializer to use, if not null ser)The method to be called by |
| public abstract DefaultSerializerProvider | withCaches(CacheProvider cacheProvider)
Fluent factory method used for constructing a new instance with cache instances provided by |
| _generator | back to summary |
|---|---|
| protected transient JsonGenerator _generator Generator used for serialization. Needed mostly for error reporting purposes.
| |
| _objectIdGenerators | back to summary |
|---|---|
| protected transient ArrayList<ObjectIdGenerator<?>> _objectIdGenerators | |
| _seenObjectIds | back to summary |
|---|---|
| protected transient Map<Object, WritableObjectId> _seenObjectIds Per-serialization map Object Ids that have seen so far, iff Object Id handling is enabled. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| DefaultSerializerProvider | back to summary |
|---|---|
| protected DefaultSerializerProvider() | |
| DefaultSerializerProvider | back to summary |
|---|---|
| protected DefaultSerializerProvider(SerializerProvider src, SerializationConfig config, SerializerFactory f) | |
| DefaultSerializerProvider | back to summary |
|---|---|
| protected DefaultSerializerProvider(DefaultSerializerProvider src) | |
| DefaultSerializerProvider | back to summary |
|---|---|
protected DefaultSerializerProvider(DefaultSerializerProvider src, CacheProvider cp)
| |
| _createObjectIdMap | back to summary |
|---|---|
| protected Map Overridable helper method used for creating
| |
| _serialize | back to summary |
|---|---|
| private final void _serialize(JsonGenerator gen, Object value, JsonSerializer<Object> ser, PropertyName rootName) throws IOException | |
| _serialize | back to summary |
|---|---|
| private final void _serialize(JsonGenerator gen, Object value, JsonSerializer<Object> ser) throws IOException | |
| _serializeNull | back to summary |
|---|---|
| protected void _serializeNull(JsonGenerator gen) throws IOException Helper method called when root value to serialize is null
| |
| _wrapAsIOE | back to summary |
|---|---|
| private IOException _wrapAsIOE(JsonGenerator g, Exception e) | |
| acceptJsonFormatVisitor | back to summary |
|---|---|
| public void acceptJsonFormatVisitor(JavaType javaType, JsonFormatVisitorWrapper visitor) throws JsonMappingException The method to be called by
| |
| cachedSerializersCount | back to summary |
|---|---|
| public 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) The main use case for this method is to allow conditional flushing of serializer cache, if certain number of entries is reached. | |
| copy | back to summary |
|---|---|
| public DefaultSerializerProvider copy() Method needed to ensure that
| |
| createInstance | back to summary |
|---|---|
| public abstract DefaultSerializerProvider createInstance(SerializationConfig config, SerializerFactory jsf) Method that sub-classes need to implement: used to create a non-blueprint instances from the blueprint. This is needed to retain state during serialization. | |
| findObjectId | back to summary |
|---|---|
| public WritableObjectId findObjectId(Object forPojo, ObjectIdGenerator<?> generatorType) Implements abstract com. Doc from com. Method called to find the Object Id for given POJO, if one has been generated. Will always return a non-null Object; contents vary depending on whether an Object Id already exists or not.
| |
| flushCachedSerializers | back to summary |
|---|---|
| public void flushCachedSerializers() Method that will drop all serializers currently cached by this provider. This can be used to remove memory usage (in case some serializers are only used once or so), or to force re-construction of serializers after configuration changes for mapper than owns the provider. | |
| generateJsonSchema | back to summary |
|---|---|
| public JsonSchema generateJsonSchema(Class<?> type) throws JsonMappingException
Deprecated Should not be used any more The method to be called by
| |
| getGenerator | back to summary |
|---|---|
| public JsonGenerator getGenerator() Overrides com. Accessor for the
| |
| hasSerializerFor | back to summary |
|---|---|
| public 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. Note that no Exceptions are thrown, including unchecked ones: implementations are to swallow exceptions if necessary. | |
| includeFilterInstance | back to summary |
|---|---|
| public Object includeFilterInstance(BeanPropertyDefinition forProperty, Class<?> filterClass) Implements abstract com. Doc from com. Method that can be called to construct and configure
| |
| includeFilterSuppressNulls | back to summary |
|---|---|
| public boolean includeFilterSuppressNulls(Object filter) throws JsonMappingException Implements abstract com. Doc from com. Follow-up method that may be called after calling
| |
| serializePolymorphic | back to summary |
|---|---|
| public void serializePolymorphic(JsonGenerator gen, Object value, JavaType rootType, JsonSerializer<Object> valueSer, TypeSerializer typeSer) throws IOException Alternate serialization call used for polymorphic types, when
| |
| serializerInstance | back to summary |
|---|---|
| public JsonSerializer Implements abstract com. Doc from com. Method that can be called to construct and configure serializer instance,
either given a | |
| serializeValue | back to summary |
|---|---|
| public void serializeValue(JsonGenerator gen, Object value) throws IOException The method to be called by | |
| serializeValue | back to summary |
|---|---|
| public void serializeValue(JsonGenerator gen, Object value, JavaType rootType) throws IOException The method to be called by
| |
| serializeValue | back to summary |
|---|---|
| public void serializeValue(JsonGenerator gen, Object value, JavaType rootType, JsonSerializer<Object> ser) throws IOException The method to be called by
| |
| withCaches | back to summary |
|---|---|
| public abstract DefaultSerializerProvider withCaches(CacheProvider cacheProvider) Fluent factory method used for constructing a new instance with cache instances provided by
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final long |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| protected | |
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public DefaultSerializerProvider | copy()
Overrides com. Method needed to ensure that |
| public DefaultSerializerProvider. | createInstance(SerializationConfig config, SerializerFactory jsf)
Implements abstract com. Method that sub-classes need to implement: used to create a non-blueprint instances from the blueprint. |
| public DefaultSerializerProvider | withCaches(CacheProvider cp)
Implements abstract com. Fluent factory method used for constructing a new instance with cache instances provided by |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides com. | |
| Impl | back to summary |
|---|---|
| public Impl() | |
| Impl | back to summary |
|---|---|
| public Impl(DefaultSerializerProvider. | |
| Impl | back to summary |
|---|---|
| protected Impl(SerializerProvider src, SerializationConfig config, SerializerFactory f) | |
| Impl | back to summary |
|---|---|
protected Impl(DefaultSerializerProvider.
| |
| copy | back to summary |
|---|---|
| public DefaultSerializerProvider copy() Overrides com. Doc from com. Method needed to ensure that
| |
| createInstance | back to summary |
|---|---|
| public DefaultSerializerProvider. Implements abstract com. Doc from com. Method that sub-classes need to implement: used to create a non-blueprint instances from the blueprint. This is needed to retain state during serialization.
| |
| withCaches | back to summary |
|---|---|
| public DefaultSerializerProvider withCaches(CacheProvider cp) Implements abstract com. Doc from com. Fluent factory method used for constructing a new instance with cache instances provided by
| |