org.codehaus.jackson.map
Class Serializers.Base

java.lang.Object
  extended by org.codehaus.jackson.map.Serializers.Base
All Implemented Interfaces:
Serializers
Direct Known Subclasses:
Serializers.None, SimpleSerializers
Enclosing interface:
Serializers

public static class Serializers.Base
extends Object
implements Serializers

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.

Since:
1.9

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.codehaus.jackson.map.Serializers
Serializers.Base, Serializers.None
 
Constructor Summary
Serializers.Base()
           
 
Method Summary
 JsonSerializer<?> findArraySerializer(SerializationConfig config, ArrayType type, BeanDescription beanDesc, BeanProperty property, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)
          Method called by serialization framework first time a serializer is needed for specified array type.
 JsonSerializer<?> findCollectionLikeSerializer(SerializationConfig config, CollectionLikeType type, BeanDescription beanDesc, BeanProperty property, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)
           
 JsonSerializer<?> findCollectionSerializer(SerializationConfig config, CollectionType type, BeanDescription beanDesc, BeanProperty property, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)
           
 JsonSerializer<?> findMapLikeSerializer(SerializationConfig config, MapLikeType type, BeanDescription beanDesc, BeanProperty property, JsonSerializer<Object> keySerializer, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)
           
 JsonSerializer<?> findMapSerializer(SerializationConfig config, MapType type, BeanDescription beanDesc, BeanProperty property, JsonSerializer<Object> keySerializer, TypeSerializer elementTypeSerializer, JsonSerializer<Object> elementValueSerializer)
           
 JsonSerializer<?> findSerializer(SerializationConfig config, JavaType type, BeanDescription beanDesc, BeanProperty property)
          Method called by serialization framework first time a serializer is needed for specified type, which is not of a container type (for which other methods are called).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Serializers.Base

public Serializers.Base()
Method Detail

findSerializer

public JsonSerializer<?> findSerializer(SerializationConfig config,
                                        JavaType type,
                                        BeanDescription beanDesc,
                                        BeanProperty property)
Description copied from interface: Serializers
Method called by serialization framework first time a serializer is needed for specified type, which is not of a container type (for which other methods are called).

Note: in version 1.7, this method was called to find serializers for all type, including container types.

Specified by:
findSerializer in interface Serializers
Parameters:
config - Serialization configuration in use
type - Fully resolved type of instances to serialize
beanDesc - Additional information about type; will always be of type BasicBeanDescription (that is, safe to cast to this more specific type)
property - Property that contains values to serialize
Returns:
Configured serializer to use for the type; or null if implementation does not recognize or support type

findArraySerializer

public JsonSerializer<?> findArraySerializer(SerializationConfig config,
                                             ArrayType type,
                                             BeanDescription beanDesc,
                                             BeanProperty property,
                                             TypeSerializer elementTypeSerializer,
                                             JsonSerializer<Object> elementValueSerializer)
Description copied from interface: Serializers
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.

Specified by:
findArraySerializer in interface Serializers

findCollectionSerializer

public JsonSerializer<?> findCollectionSerializer(SerializationConfig config,
                                                  CollectionType type,
                                                  BeanDescription beanDesc,
                                                  BeanProperty property,
                                                  TypeSerializer elementTypeSerializer,
                                                  JsonSerializer<Object> elementValueSerializer)
Specified by:
findCollectionSerializer in interface Serializers

findCollectionLikeSerializer

public JsonSerializer<?> findCollectionLikeSerializer(SerializationConfig config,
                                                      CollectionLikeType type,
                                                      BeanDescription beanDesc,
                                                      BeanProperty property,
                                                      TypeSerializer elementTypeSerializer,
                                                      JsonSerializer<Object> elementValueSerializer)
Specified by:
findCollectionLikeSerializer in interface Serializers

findMapSerializer

public JsonSerializer<?> findMapSerializer(SerializationConfig config,
                                           MapType type,
                                           BeanDescription beanDesc,
                                           BeanProperty property,
                                           JsonSerializer<Object> keySerializer,
                                           TypeSerializer elementTypeSerializer,
                                           JsonSerializer<Object> elementValueSerializer)
Specified by:
findMapSerializer in interface Serializers

findMapLikeSerializer

public JsonSerializer<?> findMapLikeSerializer(SerializationConfig config,
                                               MapLikeType type,
                                               BeanDescription beanDesc,
                                               BeanProperty property,
                                               JsonSerializer<Object> keySerializer,
                                               TypeSerializer elementTypeSerializer,
                                               JsonSerializer<Object> elementValueSerializer)
Specified by:
findMapLikeSerializer in interface Serializers