public abstract class AbstractObjectMapper<T> extends java.lang.Object implements ObjectMapper<T>
ObjectMapper. It delegates the serialization/deserialization to a serializer/deserializer.| Modifier | Constructor and Description |
|---|---|
protected |
AbstractObjectMapper(java.lang.String rootName)
Constructor for AbstractObjectMapper.
|
| Modifier and Type | Method and Description |
|---|---|
JsonDeserializer<T> |
getDeserializer()
Getter for the field
deserializer. |
JsonSerializer<T> |
getSerializer()
Getter for the field
serializer. |
protected abstract JsonDeserializer<T> |
newDeserializer()
Instantiates a new deserializer
|
protected abstract JsonSerializer<?> |
newSerializer()
Instantiates a new serializer
|
T |
read(java.lang.String in)
Reads a JSON input into an object.
|
T |
read(java.lang.String in,
JsonDeserializationContext ctx)
Reads a JSON input into an object.
|
java.lang.String |
write(T value)
Writes an object to JSON.
|
java.lang.String |
write(T value,
JsonSerializationContext ctx)
Writes an object to JSON.
|
protected AbstractObjectMapper(java.lang.String rootName)
Constructor for AbstractObjectMapper.
rootName - a String object.public T read(java.lang.String in) throws JsonDeserializationException
read in interface ObjectReader<T>in - JSON input to readJsonDeserializationException - if an exception occurs while reading the inputpublic T read(java.lang.String in, JsonDeserializationContext ctx) throws JsonDeserializationException
read in interface ObjectReader<T>in - JSON input to readctx - Context for the full reading processJsonDeserializationException - if an exception occurs while reading the inputpublic JsonDeserializer<T> getDeserializer()
Getter for the field deserializer.
JsonDeserializer used by this mapperprotected abstract JsonDeserializer<T> newDeserializer()
public java.lang.String write(T value) throws JsonSerializationException
write in interface ObjectWriter<T>value - Object to writeJsonSerializationException - if an exception occurs while writing the outputpublic java.lang.String write(T value, JsonSerializationContext ctx) throws JsonSerializationException
write in interface ObjectWriter<T>value - Object to writectx - Context for the full writing processString object.JsonSerializationException - if an exception occurs while writing the outputpublic JsonSerializer<T> getSerializer()
Getter for the field serializer.
JsonSerializer used by this mapperprotected abstract JsonSerializer<?> newSerializer()
Copyright © 2018. All Rights Reserved.