EntityType
- The type of the element of this list.public abstract class DefaultListJsonReader<EntityType> extends EntityJsonReader<List<EntityType>>
List
.
It follow the classic Nuxeo list format :
{
"entity-type": "GIVEN_ENTITY_TYPE",
"entries": [
{...}, <-- A Reader
must be able to manage this format.
{...},
...
{...}
]
}
This reader delegates the unmarshalling of entries to the MarshallerRegistry
. A Json Reader
compatible with the required type and the json format must be registered.
ctx, registry
Constructor and Description |
---|
DefaultListJsonReader(String entityType,
Class<EntityType> elClazz)
Use this constructor if the element of the list are not based on Java generic type.
|
DefaultListJsonReader(String entityType,
Class<EntityType> elClazz,
Type elGenericType)
Use this constructor if the element of the list are based on Java generic type.
|
Modifier and Type | Method and Description |
---|---|
protected List<EntityType> |
readEntity(org.codehaus.jackson.JsonNode jn)
Implement this method to read the entity.
|
read
accept, getNode, getStringField, read, readEntity
public DefaultListJsonReader(String entityType, Class<EntityType> elClazz)
entityType
- The list "entity-type".elClazz
- The class of the element of the list.public DefaultListJsonReader(String entityType, Class<EntityType> elClazz, Type elGenericType)
entityType
- The list "entity-type".elClazz
- The class of the element of the list.elGenericType
- The generic type of the list (you can use to
generate it
protected List<EntityType> readEntity(org.codehaus.jackson.JsonNode jn) throws IOException
EntityJsonReader
readEntity
in class EntityJsonReader<List<EntityType>>
jn
- A JsonNode
pointing at the root of the json input.IOException
Copyright © 2016 Nuxeo SA. All rights reserved.