EntityType- The Java type whose the generated JSON will be enriched.
public abstract class AbstractJsonEnricher<EntityType> extends AbstractJsonWriter<Enriched<EntityType>>
|Modifier and Type||Field and Description|
|Modifier and Type||Method and Description|
Checks if this marshaller can handle the marshalling request.
Implement this method to writes the entity in the provided
When implementing this method, the provided
getGenerator, write, writeEntity, writeEntity, writeEntityField
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
This method implementation can use injected properties. So you can check the current
accept or reject a marshalling request.
clazz- The type to marshall.
genericType- The generic type to marshall.
mediatype- The managed mimetype.
public void write(Enriched<EntityType> enrichable, org.codehaus.jackson.JsonGenerator jg) throws IOException
This method implementation can use injected properties.
JsonGenerator's flushing is done by this abstract class, it's also not not necessary to flush it. Do
not close the provided
JsonGenerator. It may be used is another marshaller calling this one.
public abstract void write(org.codehaus.jackson.JsonGenerator jg, EntityType enriched) throws IOException
JsonGeneratorexpect you write a field name and a field value (or many).
enriched- The enriched entity.
Copyright © 2018 Nuxeo. All rights reserved.