public interface TypeConverter<T>
| Modifier and Type | Method and Description |
|---|---|
T |
parse(com.fasterxml.jackson.core.JsonParser jsonParser)
Called to parse the current object in the jsonParser to an object of type T
|
void |
serialize(T object,
java.lang.String fieldName,
boolean writeFieldNameForObject,
com.fasterxml.jackson.core.JsonGenerator jsonGenerator)
Called to serialize an object of type T to JSON using the JsonGenerator and field name.
|
T parse(com.fasterxml.jackson.core.JsonParser jsonParser) throws java.io.IOException
jsonParser - The JsonParser that is pre-configured for this field.java.io.IOExceptionvoid serialize(T object, java.lang.String fieldName, boolean writeFieldNameForObject, com.fasterxml.jackson.core.JsonGenerator jsonGenerator) throws java.io.IOException
object - The object to serializefieldName - The JSON field name of the object when it is serializedwriteFieldNameForObject - If true, you're responsible for calling jsonGenerator.writeFieldName(fieldName) before writing the fieldjsonGenerator - The JsonGenerator object to which the object should be writtenjava.io.IOException