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 theDocumentModelJson 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 StringCONF_DOCUMENT_JSON_LEGACYstatic StringHEADER_DOCUMENT_JSON_LEGACY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediatype)Checks if this marshaller can handle the marshalling request.static voidpushInstanceIfNeeded(RenderingContext ctx, javax.servlet.http.HttpServletRequest request, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders)DocumentModelread(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediaType, InputStream in)Read the entity from inInputStreamusing 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:MarshallerChecks 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
Supportsis compatible with mediatype. This is already done by theMarshallerRegistryThis method implementation can use injected properties. So you can check the current
RenderingContextto accept or reject a marshalling request.- Specified by:
acceptin 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:ReaderRead the entity from inInputStreamusing mediatype format.This method implementation can use injected properties.
- Specified by:
readin 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.
-
-