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": ... <-- seeDocumentPropertiesJsonReader}- Since:
- 7.2
-
-
Field Summary
Fields Modifier and Type Field Description static StringLEGACY_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 voidapplyAllPropertyValues(DocumentModel src, DocumentModel dst)static voidapplyDirtyPropertyValues(DocumentModel src, DocumentModel dst)protected static voidapplyPropertyValue(DataModelImpl srcDataModel, DataModelImpl dstDataModel, String fieldName)Deprecated.since 11.1.protected static voidapplyPropertyValue(Property property, DocumentModel dst)static voidapplyPropertyValues(DocumentModel src, DocumentModel dst)static voidapplyPropertyValues(DocumentModel src, DocumentModel dst, boolean dirtyOnly)protected DocumentModelgetDocument(com.fasterxml.jackson.databind.JsonNode jn)protected static StringgetXPath(Property property)DocumentModelread(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediaType, InputStream in)Read the entity from inInputStreamusing mediatype format.protected DocumentModelreadEntity(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
-
-
Constructor Detail
-
DocumentModelJsonReader
public DocumentModelJsonReader()
-
-
Method Detail
-
read
public DocumentModel read(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediaType, InputStream in) throws IOException
Description copied from interface:ReaderRead the entity from inInputStreamusing mediatype format.This method implementation can use injected properties.
- Specified by:
readin interfaceReader<DocumentModel>- Overrides:
readin 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:EntityJsonReaderImplement this method to read the entity.- Specified by:
readEntityin classEntityJsonReader<DocumentModel>- Parameters:
jn- AJsonNodepointing 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.
-
-