Class ConstraintJsonWriter
java.lang.Object
org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<EntityType>
org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter<Constraint>
org.nuxeo.ecm.core.io.marshallers.json.validation.ConstraintJsonWriter
- All Implemented Interfaces:
Marshaller<Constraint>
,Writer<Constraint>
@Setup(mode=SINGLETON,
priority=2000)
public class ConstraintJsonWriter
extends ExtensibleEntityJsonWriter<Constraint>
Convert
Constraint
to Json.
This marshaller is enrichable: register class implementing AbstractJsonEnricher
and managing
Constraint
.
This marshaller is also extensible: extend it and simply override
ExtensibleEntityJsonWriter.extend(Object, JsonGenerator)
.
Format is:
{ "entity-type":"validation_constraint", "name": "CONSTRAINT_NAME", "parameters": { "PARAMETER1_NAME": "PARAMETER1_VALUE", "PARAMETER2_NAME": "PARAMETER2_VALUE", ... } <-- contextParameters if there are enrichers activated <-- additional property provided by extend() method }
- Since:
- 7.2
-
Field Summary
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
writeEntityBody
(Constraint constraint, com.fasterxml.jackson.core.JsonGenerator jg) Implement this method to write the entity body.Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter
extend, write
Methods inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
accept, getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
-
Field Details
-
ENTITY_TYPE
- See Also:
-
-
Constructor Details
-
ConstraintJsonWriter
public ConstraintJsonWriter()
-
-
Method Details
-
writeEntityBody
protected void writeEntityBody(Constraint constraint, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException Description copied from class:ExtensibleEntityJsonWriter
Implement this method to write the entity body.- Specified by:
writeEntityBody
in classExtensibleEntityJsonWriter<Constraint>
- Parameters:
constraint
- The Java entity.jg
- AJsonGenerator
ready to write your entity as Json.- Throws:
IOException
-