Class DocumentModelJsonReaderLegacy
- java.lang.Object
-
- org.nuxeo.ecm.webengine.jaxrs.coreiodelegate.DocumentModelJsonReaderLegacy
-
- All Implemented Interfaces:
Marshaller<DocumentModel>
,Reader<DocumentModel>
@Setup(mode=SINGLETON, priority=1000) @Supports("application/json") public class DocumentModelJsonReaderLegacy extends Object implements Reader<DocumentModel>
Delegates theDocumentModel
Json reading to the old marshaller: JSONDocumentModelReader.It's enable if system property nuxeo.document.json.legacy=true or if request header X-NXDocumentJsonLegacy=true.
- Since:
- 7.2
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONF_DOCUMENT_JSON_LEGACY
static String
HEADER_DOCUMENT_JSON_LEGACY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accept(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediatype)
Checks if this marshaller can handle the marshalling request.static void
pushInstanceIfNeeded(RenderingContext ctx, javax.servlet.http.HttpServletRequest request, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders)
DocumentModel
read(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediaType, InputStream in)
Read the entity from inInputStream
using mediatype format.
-
-
-
Field Detail
-
CONF_DOCUMENT_JSON_LEGACY
public static final String CONF_DOCUMENT_JSON_LEGACY
- See Also:
- Constant Field Values
-
HEADER_DOCUMENT_JSON_LEGACY
public static final String HEADER_DOCUMENT_JSON_LEGACY
- See Also:
- Constant Field Values
-
-
Method Detail
-
pushInstanceIfNeeded
public static void pushInstanceIfNeeded(RenderingContext ctx, javax.servlet.http.HttpServletRequest request, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders)
-
accept
public boolean accept(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediatype)
Description copied from interface:Marshaller
Checks if this marshaller can handle the marshalling request.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 theMarshallerRegistry
This method implementation can use injected properties. So you can check the current
RenderingContext
to accept or reject a marshalling request.- Specified by:
accept
in interfaceMarshaller<DocumentModel>
- Parameters:
clazz
- The type to marshall.genericType
- The generic type to marshall.mediatype
- The managed mimetype.- Returns:
- true if this converter handle the request, false otherwise.
-
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>
- 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.
-
-