public abstract class JsonCodec<T> extends Object
| Constructor and Description |
|---|
JsonCodec() |
| Modifier and Type | Method and Description |
|---|---|
List<T> |
decode(com.fasterxml.jackson.databind.node.ArrayNode json,
CodecContext context)
Decodes the specified JSON array into a collection of entities.
|
T |
decode(com.fasterxml.jackson.databind.node.ObjectNode json,
CodecContext context)
Decodes the specified entity from JSON.
|
com.fasterxml.jackson.databind.node.ArrayNode |
encode(Iterable<T> entities,
CodecContext context)
Encodes the collection of the specified entities.
|
com.fasterxml.jackson.databind.node.ObjectNode |
encode(T entity,
CodecContext context)
Encodes the specified entity into JSON.
|
protected static com.fasterxml.jackson.databind.node.ObjectNode |
get(com.fasterxml.jackson.databind.JsonNode parent,
int childIndex)
Gets a child Object Node from a parent by index.
|
protected static com.fasterxml.jackson.databind.node.ObjectNode |
get(com.fasterxml.jackson.databind.node.ObjectNode parent,
String childName)
Gets a child Object Node from a parent by name.
|
public com.fasterxml.jackson.databind.node.ObjectNode encode(T entity, CodecContext context)
entity - entity to encodecontext - encoding contextUnsupportedOperationException - if the codec does not
support encode operationspublic T decode(com.fasterxml.jackson.databind.node.ObjectNode json, CodecContext context)
json - JSON to decodecontext - decoding contextUnsupportedOperationException - if the codec does not
support decode operationspublic com.fasterxml.jackson.databind.node.ArrayNode encode(Iterable<T> entities, CodecContext context)
entities - collection of entities to encodecontext - encoding contextUnsupportedOperationException - if the codec does not
support encode operationspublic List<T> decode(com.fasterxml.jackson.databind.node.ArrayNode json, CodecContext context)
json - JSON array to decodecontext - decoding contextUnsupportedOperationException - if the codec does not
support decode operationsprotected static com.fasterxml.jackson.databind.node.ObjectNode get(com.fasterxml.jackson.databind.node.ObjectNode parent,
String childName)
parent - parent objectchildName - name of child to queryprotected static com.fasterxml.jackson.databind.node.ObjectNode get(com.fasterxml.jackson.databind.JsonNode parent,
int childIndex)
parent - parent objectchildIndex - index of child to query