EntityType
- The managed Java type.public interface Marshaller<EntityType>
You must add Setup
annotation to every class implementing this interface. You should add Supports
annotation to define supported mimetype. You can add Inject
annotation to your properties to get current
RenderingContext
or any Nuxeo service.
To get an instance of this class with injected properties, call
MarshallerRegistry.getInstance(RenderingContext, Class)
.
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Class<?> clazz,
Type genericType,
javax.ws.rs.core.MediaType mediatype)
Checks if this marshaller can handle the marshalling request.
|
boolean accept(Class<?> clazz, Type genericType, javax.ws.rs.core.MediaType mediatype)
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 the MarshallerRegistry
This method implementation can use injected properties. So you can check the current RenderingContext
to
accept or reject a marshalling request.
clazz
- The type to marshall.genericType
- The generic type to marshall.mediatype
- The managed mimetype.Copyright © 2017 Nuxeo. All rights reserved.