Top Description Inners Methods
com.fasterxml.jackson.databind.ser

public Interface Serializers

Known Direct Implementers
com.fasterxml.jackson.databind.ser.Serializers.Base
Imports
com.fasterxml.jackson.databind.*, com.fasterxml.jackson.databind.jsontype.TypeSerializer, com.fasterxml.jackson.databind.type.*

Interface that defines API for simple extensions that can provide additional serializers for various types. Access is by a single callback method; instance is to either return a configured JsonSerializer for specified type, or null to indicate that it does not support handling of the type. In latter case, further calls can be made for other providers; in former case returned serializer is used for handling of instances of specified type.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Serializers.Base

Basic Serializers implementation that implements all methods but provides no serializers.

Method Summary

Modifier and TypeMethod and Description
public JsonSerializer<?>
findArraySerializer(SerializationConfig config, ArrayType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Method called by serialization framework first time a serializer is needed for specified array type.

public JsonSerializer<?>
findCollectionLikeSerializer(SerializationConfig config, CollectionLikeType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Method called by serialization framework first time a serializer is needed for specified "Collection-like" type (type that acts like java.util.Collection, but does not implement it).

public JsonSerializer<?>
findCollectionSerializer(SerializationConfig config, CollectionType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Method called by serialization framework first time a serializer is needed for specified java.util.Collection type.

public JsonSerializer<?>
findMapLikeSerializer(SerializationConfig config, MapLikeType type, BeanDescription beanDesc, JsonSerializer<Object> keySerializer, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Method called by serialization framework first time a serializer is needed for specified "Map-like" type (type that acts like java.util.Map, but does not implement it).

public JsonSerializer<?>
findMapSerializer(SerializationConfig config, MapType type, BeanDescription beanDesc, JsonSerializer<Object> keySerializer, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Method called by serialization framework first time a serializer is needed for specified java.util.Map type.

public JsonSerializer<?>
findReferenceSerializer(SerializationConfig config, ReferenceType type, BeanDescription beanDesc, TypeSerializer contentTypeSerializer, JsonSerializer<Object> contentValueSerializer)

Method called by serialization framework first time a serializer is needed for given ReferenceType

public JsonSerializer<?>

Returns:

Configured serializer to use for the type; or null if implementation does not recognize or support type
findSerializer
(SerializationConfig
Serialization configuration in use
config
,
JavaType
Fully resolved type of instances to serialize
type
,
BeanDescription
Additional information about type
beanDesc
)

Method called by serialization framework first time a serializer is needed for specified type, which is not of a container or reference type (for which other methods are called).

Method Detail

findArraySerializerback to summary
public JsonSerializer<?> findArraySerializer(SerializationConfig config, ArrayType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Method called by serialization framework first time a serializer is needed for specified array type. Implementation should return a serializer instance if it supports specified type; or null if it does not.

findCollectionLikeSerializerback to summary
public JsonSerializer<?> findCollectionLikeSerializer(SerializationConfig config, CollectionLikeType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Method called by serialization framework first time a serializer is needed for specified "Collection-like" type (type that acts like java.util.Collection, but does not implement it). Implementation should return a serializer instance if it supports specified type; or null if it does not.

findCollectionSerializerback to summary
public JsonSerializer<?> findCollectionSerializer(SerializationConfig config, CollectionType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Method called by serialization framework first time a serializer is needed for specified java.util.Collection type. Implementation should return a serializer instance if it supports specified type; or null if it does not.

findMapLikeSerializerback to summary
public JsonSerializer<?> findMapLikeSerializer(SerializationConfig config, MapLikeType type, BeanDescription beanDesc, JsonSerializer<Object> keySerializer, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Method called by serialization framework first time a serializer is needed for specified "Map-like" type (type that acts like java.util.Map, but does not implement it). Implementation should return a serializer instance if it supports specified type; or null if it does not.

findMapSerializerback to summary
public JsonSerializer<?> findMapSerializer(SerializationConfig config, MapType type, BeanDescription beanDesc, JsonSerializer<Object> keySerializer, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Method called by serialization framework first time a serializer is needed for specified java.util.Map type. Implementation should return a serializer instance if it supports specified type; or null if it does not.

findReferenceSerializerback to summary
public JsonSerializer<?> findReferenceSerializer(SerializationConfig config, ReferenceType type, BeanDescription beanDesc, TypeSerializer contentTypeSerializer, JsonSerializer<Object> contentValueSerializer)

Method called by serialization framework first time a serializer is needed for given ReferenceType

Since
2.7
findSerializerback to summary
public JsonSerializer<?> findSerializer(SerializationConfig config, JavaType type, BeanDescription beanDesc)

Method called by serialization framework first time a serializer is needed for specified type, which is not of a container or reference type (for which other methods are called).

Parameters
config:SerializationConfig

Serialization configuration in use

type:JavaType

Fully resolved type of instances to serialize

beanDesc:BeanDescription

Additional information about type

Returns:JsonSerializer<?>

Configured serializer to use for the type; or null if implementation does not recognize or support type

com.fasterxml.jackson.databind.ser back to summary

public Class Serializers.Base

extends Object
implements Serializers
Class Inheritance
All Implemented Interfaces
com.fasterxml.jackson.databind.ser.Serializers
Known Direct Subclasses
com.fasterxml.jackson.databind.ext.CoreXMLSerializers, com.fasterxml.jackson.databind.module.SimpleSerializers

Basic Serializers implementation that implements all methods but provides no serializers. Its main purpose is to serve as a base class so that sub-classes only need to override methods they need.

Constructor Summary

AccessConstructor and Description
public
Base()

Method Summary

Modifier and TypeMethod and Description
public JsonSerializer<?>
findArraySerializer(SerializationConfig config, ArrayType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Implements com.fasterxml.jackson.databind.ser.Serializers.findArraySerializer.

Method called by serialization framework first time a serializer is needed for specified array type.

public JsonSerializer<?>
findCollectionLikeSerializer(SerializationConfig config, CollectionLikeType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Implements com.fasterxml.jackson.databind.ser.Serializers.findCollectionLikeSerializer.

Method called by serialization framework first time a serializer is needed for specified "Collection-like" type (type that acts like java.util.Collection, but does not implement it).

public JsonSerializer<?>
findCollectionSerializer(SerializationConfig config, CollectionType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Implements com.fasterxml.jackson.databind.ser.Serializers.findCollectionSerializer.

Method called by serialization framework first time a serializer is needed for specified java.util.Collection type.

public JsonSerializer<?>
findMapLikeSerializer(SerializationConfig config, MapLikeType type, BeanDescription beanDesc, JsonSerializer<Object> keySerializer, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Implements com.fasterxml.jackson.databind.ser.Serializers.findMapLikeSerializer.

Method called by serialization framework first time a serializer is needed for specified "Map-like" type (type that acts like java.util.Map, but does not implement it).

public JsonSerializer<?>
findMapSerializer(SerializationConfig config, MapType type, BeanDescription beanDesc, JsonSerializer<Object> keySerializer, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Implements com.fasterxml.jackson.databind.ser.Serializers.findMapSerializer.

Method called by serialization framework first time a serializer is needed for specified java.util.Map type.

public JsonSerializer<?>
findReferenceSerializer(SerializationConfig config, ReferenceType type, BeanDescription beanDesc, TypeSerializer contentTypeSerializer, JsonSerializer<Object> contentValueSerializer)

Implements com.fasterxml.jackson.databind.ser.Serializers.findReferenceSerializer.

Method called by serialization framework first time a serializer is needed for given ReferenceType

public JsonSerializer<?>
findSerializer(SerializationConfig
Serialization configuration in use
config
,
JavaType
Fully resolved type of instances to serialize
type
,
BeanDescription
Additional information about type
beanDesc
)

Implements com.fasterxml.jackson.databind.ser.Serializers.findSerializer.

Method called by serialization framework first time a serializer is needed for specified type, which is not of a container or reference type (for which other methods are called).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Baseback to summary
public Base()

Method Detail

findArraySerializerback to summary
public JsonSerializer<?> findArraySerializer(SerializationConfig config, ArrayType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Implements com.fasterxml.jackson.databind.ser.Serializers.findArraySerializer.

Doc from com.fasterxml.jackson.databind.ser.Serializers.findArraySerializer.

Method called by serialization framework first time a serializer is needed for specified array type. Implementation should return a serializer instance if it supports specified type; or null if it does not.

Annotations
@Override
findCollectionLikeSerializerback to summary
public JsonSerializer<?> findCollectionLikeSerializer(SerializationConfig config, CollectionLikeType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Implements com.fasterxml.jackson.databind.ser.Serializers.findCollectionLikeSerializer.

Doc from com.fasterxml.jackson.databind.ser.Serializers.findCollectionLikeSerializer.

Method called by serialization framework first time a serializer is needed for specified "Collection-like" type (type that acts like java.util.Collection, but does not implement it). Implementation should return a serializer instance if it supports specified type; or null if it does not.

Annotations
@Override
findCollectionSerializerback to summary
public JsonSerializer<?> findCollectionSerializer(SerializationConfig config, CollectionType type, BeanDescription beanDesc, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Implements com.fasterxml.jackson.databind.ser.Serializers.findCollectionSerializer.

Doc from com.fasterxml.jackson.databind.ser.Serializers.findCollectionSerializer.

Method called by serialization framework first time a serializer is needed for specified java.util.Collection type. Implementation should return a serializer instance if it supports specified type; or null if it does not.

Annotations
@Override
findMapLikeSerializerback to summary
public JsonSerializer<?> findMapLikeSerializer(SerializationConfig config, MapLikeType type, BeanDescription beanDesc, JsonSerializer<Object> keySerializer, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Implements com.fasterxml.jackson.databind.ser.Serializers.findMapLikeSerializer.

Doc from com.fasterxml.jackson.databind.ser.Serializers.findMapLikeSerializer.

Method called by serialization framework first time a serializer is needed for specified "Map-like" type (type that acts like java.util.Map, but does not implement it). Implementation should return a serializer instance if it supports specified type; or null if it does not.

Annotations
@Override
findMapSerializerback to summary
public JsonSerializer<?> findMapSerializer(SerializationConfig config, MapType type, BeanDescription beanDesc, JsonSerializer<Object> keySerializer, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)

Implements com.fasterxml.jackson.databind.ser.Serializers.findMapSerializer.

Doc from com.fasterxml.jackson.databind.ser.Serializers.findMapSerializer.

Method called by serialization framework first time a serializer is needed for specified java.util.Map type. Implementation should return a serializer instance if it supports specified type; or null if it does not.

Annotations
@Override
findReferenceSerializerback to summary
public JsonSerializer<?> findReferenceSerializer(SerializationConfig config, ReferenceType type, BeanDescription beanDesc, TypeSerializer contentTypeSerializer, JsonSerializer<Object> contentValueSerializer)

Implements com.fasterxml.jackson.databind.ser.Serializers.findReferenceSerializer.

Doc from com.fasterxml.jackson.databind.ser.Serializers.findReferenceSerializer.

Method called by serialization framework first time a serializer is needed for given ReferenceType

Annotations
@Override
findSerializerback to summary
public JsonSerializer<?> findSerializer(SerializationConfig config, JavaType type, BeanDescription beanDesc)

Implements com.fasterxml.jackson.databind.ser.Serializers.findSerializer.

Doc from com.fasterxml.jackson.databind.ser.Serializers.findSerializer.

Method called by serialization framework first time a serializer is needed for specified type, which is not of a container or reference type (for which other methods are called).

Parameters
config:SerializationConfig

Serialization configuration in use

type:JavaType

Fully resolved type of instances to serialize

beanDesc:BeanDescription

Additional information about type

Returns:JsonSerializer<?>

Configured serializer to use for the type; or null if implementation does not recognize or support type

Annotations
@Override