public class AbstractWebResource extends BaseResource implements CodecContext
| Constructor and Description |
|---|
AbstractWebResource() |
| Modifier and Type | Method and Description |
|---|---|
<T> JsonCodec<T> |
codec(java.lang.Class<T> entityClass)
Returns the JSON codec for the specified entity class.
|
protected <T> com.fasterxml.jackson.databind.node.ObjectNode |
encodeArray(java.lang.Class<T> codecClass,
java.lang.String field,
java.lang.Iterable<T> items)
Returns JSON object wrapping the array encoding of the specified
collection of items.
|
<T> T |
getService(java.lang.Class<T> serviceClass)
Returns reference to the specified service implementation.
|
com.fasterxml.jackson.databind.ObjectMapper |
mapper()
Returns the JSON object mapper.
|
com.fasterxml.jackson.databind.node.ArrayNode |
newArray(com.fasterxml.jackson.databind.node.ObjectNode parent,
java.lang.String key)
Creates and returns a new child array within the specified parent and
bound to the given key.
|
com.fasterxml.jackson.databind.node.ObjectNode |
newObject(com.fasterxml.jackson.databind.node.ObjectNode parent,
java.lang.String key)
Creates and returns a new child object within the specified parent and
bound to the given key.
|
get, ok, setServiceDirectoryclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdecode, encodepublic com.fasterxml.jackson.databind.ObjectMapper mapper()
CodecContextmapper in interface CodecContextpublic <T> JsonCodec<T> codec(java.lang.Class<T> entityClass)
codec in interface CodecContextT - entity typeentityClass - entity classprotected <T> com.fasterxml.jackson.databind.node.ObjectNode encodeArray(java.lang.Class<T> codecClass,
java.lang.String field,
java.lang.Iterable<T> items)
T - item typecodecClass - codec item classfield - field holding the arrayitems - collection of items to be encoded into arraypublic <T> T getService(java.lang.Class<T> serviceClass)
CodecContextgetService in interface CodecContextT - service typeserviceClass - service classpublic com.fasterxml.jackson.databind.node.ObjectNode newObject(com.fasterxml.jackson.databind.node.ObjectNode parent,
java.lang.String key)
parent - parent objectkey - key for the new child objectpublic com.fasterxml.jackson.databind.node.ArrayNode newArray(com.fasterxml.jackson.databind.node.ObjectNode parent,
java.lang.String key)
parent - parent objectkey - key for the new child array