org.codehaus.jackson.map.SerializerFactory Maven / Gradle / Ivy
Go to download
Data Mapper package is a high-performance data binding package
built on Jackson JSON processor
package org.codehaus.jackson.map;
import org.codehaus.jackson.map.type.TypeFactory;
import org.codehaus.jackson.type.JavaType;
/**
* Abstract class that defines API used by {@link SerializerProvider}
* to obtain actual
* {@link JsonSerializer} instances from multiple distinct factories.
*/
public abstract class SerializerFactory
{
/*
/********************************************************
/* Basic SerializerFactory API:
/********************************************************
*/
/**
* Method called to create (or, for immutable serializers, reuse)
* a serializer for given type.
*
* @param type Type to be serialized
* @param config Generic serialization configuration
*
* @deprecated Use {@link #createSerializer(JavaType,SerializationConfig)} instead
*/
@SuppressWarnings("unchecked")
@Deprecated
public JsonSerializer createSerializer(Class type, SerializationConfig config) {
return (JsonSerializer) createSerializer(TypeFactory.type(type), config);
}
/**
* Method called to create (or, for immutable serializers, reuse)
* a serializer for given type.
*
* Default implementation just calls {@link #createSerializer(Class, SerializationConfig)};
* sub-classes need to override method
*
* @param type Type to be serialized
* @param config Generic serialization configuration
*/
@SuppressWarnings("unchecked")
public JsonSerializer