@Setup(mode=SINGLETON, priority=2000) public class DocumentModelJsonReader extends EntityJsonReader<DocumentModel>
DocumentModel
.
Format is (any additional json property is ignored):
{
"entity-type": "document",
"uid": "EXISTING_DOCUMENT_UID", <- use it to update an existing document
"repository": "REPOSITORY_NAME" , <- explicitely specify the repository name
"name": "DOCUMENT_NAME", <- use it to create an new document
"type": "DOCUMENT_TYPE", <- use it to create an new document
"properties": ... <-- see DocumentPropertiesJsonReader
}
Modifier and Type | Field and Description |
---|---|
static String |
LEGACY_MODE_READER |
ctx, registry
Constructor and Description |
---|
DocumentModelJsonReader() |
Modifier and Type | Method and Description |
---|---|
static void |
applyPropertyValues(DocumentModel src,
DocumentModel dst) |
DocumentModel |
read(Class<?> clazz,
Type genericType,
javax.ws.rs.core.MediaType mediaType,
InputStream in)
Read the entity from in
InputStream using mediatype format. |
protected DocumentModel |
readEntity(org.codehaus.jackson.JsonNode jn)
Implement this method to read the entity.
|
read
accept, getNode, getStringField, readEntity
public static final String LEGACY_MODE_READER
public DocumentModelJsonReader()
public DocumentModel read(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediaType, InputStream in) throws IOException
Reader
InputStream
using mediatype format.
This method implementation can use injected properties.
read
in interface Reader<DocumentModel>
read
in class AbstractJsonReader<DocumentModel>
clazz
- The requested marshalled class.genericType
- The requested marshalled generic type.in
- The input of this marshaller.IOException
- If some error append while reading entity from in.protected DocumentModel readEntity(org.codehaus.jackson.JsonNode jn) throws IOException
EntityJsonReader
readEntity
in class EntityJsonReader<DocumentModel>
jn
- A JsonNode
pointing at the root of the json input.IOException
public static void applyPropertyValues(DocumentModel src, DocumentModel dst)
Copyright © 2016 Nuxeo SA. All rights reserved.