org.codehaus.jackson.map
Class JsonSerializer<T>
java.lang.Object
org.codehaus.jackson.map.JsonSerializer<T>
- Direct Known Subclasses:
- FailingSerializer, JsonSerializer.None, JsonValueSerializer, SerializerBase, XmlAdapterJsonSerializer
public abstract class JsonSerializer<T>
- extends Object
Abstract class that defines API used by ObjectMapper
(and
other chained JsonSerializer
s too) to serialize Objects of
arbitrary types into JSON, using provided JsonGenerator
.
Nested Class Summary |
static class |
JsonSerializer.None
This marker class is only to be used with annotations, to
indicate that no serializer is configured. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JsonSerializer
public JsonSerializer()
serialize
public abstract void serialize(T value,
JsonGenerator jgen,
SerializerProvider provider)
throws IOException,
JsonProcessingException
- Method that can be called to ask implementation to serialize
values of type this serializer handles.
- Parameters:
value
- Value to serialize; can not be null.jgen
- Generator used to output resulting Json contentprovider
- Provider that can be used to get serializers for
serializing Objects value contains, if any.
- Throws:
IOException
JsonProcessingException