@Setup(mode=SINGLETON, priority=2000) public class TaskCompletionRequestJsonReader extends EntityJsonReader<TaskCompletionRequest>
Modifier and Type | Field and Description |
---|---|
static String |
ENTITY_TYPE |
ctx, registry
Constructor and Description |
---|
TaskCompletionRequestJsonReader() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Class<?> clazz,
Type genericType,
javax.ws.rs.core.MediaType mediatype)
Checks if this marshaller can handle the marshalling request.
|
TaskCompletionRequest |
readEntity(org.codehaus.jackson.JsonNode jn)
Implement this method to read the entity.
|
read
getNode, getStringField, read, readEntity
public static final String ENTITY_TYPE
public TaskCompletionRequestJsonReader()
public boolean accept(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediatype)
Marshaller
Please note it's useless to check that clazz is an instance of EntityType or if generic type and entity type are
compatible (unlike JAX-RS which just checks the clazz, not the generic type). It's also useless to check
Supports
is compatible with mediatype. This is already done by the MarshallerRegistry
This method implementation can use injected properties. So you can check the current RenderingContext
to
accept or reject a marshalling request.
accept
in interface Marshaller<TaskCompletionRequest>
accept
in class AbstractJsonReader<TaskCompletionRequest>
clazz
- The type to marshall.genericType
- The generic type to marshall.mediatype
- The managed mimetype.public TaskCompletionRequest readEntity(org.codehaus.jackson.JsonNode jn) throws IOException
EntityJsonReader
readEntity
in class EntityJsonReader<TaskCompletionRequest>
jn
- A JsonNode
pointing at the root of the json input.IOException
Copyright © 2016 Nuxeo SA. All rights reserved.