Class DocumentModelJsonReader
- java.lang.Object
-
- org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonReader<EntityType>
-
- org.nuxeo.ecm.core.io.marshallers.json.EntityJsonReader<DocumentModel>
-
- org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonReader
-
- All Implemented Interfaces:
Marshaller<DocumentModel>
,Reader<DocumentModel>
@Setup(mode=SINGLETON, priority=2000) public class DocumentModelJsonReader extends EntityJsonReader<DocumentModel>
Convert Json asDocumentModel
.Format is (any additional json property is ignored):
{ "entity-type": "document", "uid": "EXISTING_DOCUMENT_UID", <- use it to update an existing document "name": "DOCUMENT_NAME", <- use it to create an new document "type": "DOCUMENT_TYPE", <- use it to create an new document "changeToken": "CHANGE_TOKEN", <- pass the previous change token for optimistic locking "properties": ... <-- see
DocumentPropertiesJsonReader
}- Since:
- 7.2
-
-
Field Summary
Fields Modifier and Type Field Description static String
LEGACY_MODE_READER
-
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonReader
ctx, registry
-
-
Constructor Summary
Constructors Constructor Description DocumentModelJsonReader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static void
applyAllPropertyValues(DocumentModel src, DocumentModel dst)
static void
applyDirtyPropertyValues(DocumentModel src, DocumentModel dst)
protected static void
applyPropertyValue(DataModelImpl srcDataModel, DataModelImpl dstDataModel, String fieldName)
Deprecated.since 11.1.protected static void
applyPropertyValue(Property property, DocumentModel dst)
static void
applyPropertyValues(DocumentModel src, DocumentModel dst)
static void
applyPropertyValues(DocumentModel src, DocumentModel dst, boolean dirtyOnly)
protected DocumentModel
getDocument(com.fasterxml.jackson.databind.JsonNode jn)
protected static String
getXPath(Property property)
DocumentModel
read(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediaType, InputStream in)
Read the entity from inInputStream
using mediatype format.protected DocumentModel
readEntity(com.fasterxml.jackson.databind.JsonNode jn)
Implement this method to read the entity.-
Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.EntityJsonReader
read
-
Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonReader
accept, getBooleanField, getLongField, getNode, getStringField, getStringListField, readEntity
-
-
-
-
Field Detail
-
LEGACY_MODE_READER
public static final String LEGACY_MODE_READER
- See Also:
- Constant Field Values
-
-
Method Detail
-
read
public DocumentModel read(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediaType, InputStream in) throws IOException
Description copied from interface:Reader
Read the entity from inInputStream
using mediatype format.This method implementation can use injected properties.
- Specified by:
read
in interfaceReader<DocumentModel>
- Overrides:
read
in classAbstractJsonReader<DocumentModel>
- Parameters:
clazz
- The requested marshalled class.genericType
- The requested marshalled generic type.mediaType
- The input media type.in
- The input of this marshaller.- Throws:
IOException
- If some error append while reading entity from in.
-
readEntity
protected DocumentModel readEntity(com.fasterxml.jackson.databind.JsonNode jn) throws IOException
Description copied from class:EntityJsonReader
Implement this method to read the entity.- Specified by:
readEntity
in classEntityJsonReader<DocumentModel>
- Parameters:
jn
- AJsonNode
pointing at the root of the json input.- Returns:
- The parsed entity.
- Throws:
IOException
-
getDocument
protected DocumentModel getDocument(com.fasterxml.jackson.databind.JsonNode jn) throws IOException
- Throws:
IOException
- Since:
- 11.1
-
applyPropertyValues
public static void applyPropertyValues(DocumentModel src, DocumentModel dst)
-
applyPropertyValues
public static void applyPropertyValues(DocumentModel src, DocumentModel dst, boolean dirtyOnly)
-
applyDirtyPropertyValues
public static void applyDirtyPropertyValues(DocumentModel src, DocumentModel dst)
-
applyAllPropertyValues
public static void applyAllPropertyValues(DocumentModel src, DocumentModel dst)
-
applyPropertyValue
protected static void applyPropertyValue(Property property, DocumentModel dst)
-
applyPropertyValue
@Deprecated(since="11.1") protected static void applyPropertyValue(DataModelImpl srcDataModel, DataModelImpl dstDataModel, String fieldName)
Deprecated.since 11.1. Not used anymore.
-
-