Class DocumentValidationReportJsonWriter
- java.lang.Object
-
- org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter<EntityType>
-
- org.nuxeo.ecm.core.io.marshallers.json.ExtensibleEntityJsonWriter<DocumentValidationReport>
-
- org.nuxeo.ecm.core.io.marshallers.json.validation.DocumentValidationReportJsonWriter
-
- All Implemented Interfaces:
Marshaller<DocumentValidationReport>
,Writer<DocumentValidationReport>
@Setup(mode=SINGLETON, priority=2000) public class DocumentValidationReportJsonWriter extends ExtensibleEntityJsonWriter<DocumentValidationReport>
ConvertDocumentValidationReport
to Json.This marshaller is enrichable: register class implementing
AbstractJsonEnricher
and managingDocumentValidationReport
.This marshaller is also extensible: extend it and simply override
ExtensibleEntityJsonWriter.extend(Object, JsonGenerator)
.Format is:
{ "entity-type":"validation_report", "has_error": true|false, "number": 123, <- number of errors present in this report "violations": [ { "message": "TheErrorMessage", "invalid_value": null|"THE_INVALID_VALUE_AS_STRING", "constraint": { see
ConstraintJsonWriter
format } }, ... ] <-- contextParameters if there are enrichers activated <-- additional property provided by extend() method }- Since:
- 7.2
-
-
Field Summary
Fields Modifier and Type Field Description static String
ENTITY_TYPE
-
Fields inherited from class org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonWriter
ctx, registry
-
-
Constructor Summary
Constructors Constructor Description DocumentValidationReportJsonWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
writeEntityBody(DocumentValidationReport report, 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 Detail
-
ENTITY_TYPE
public static final String ENTITY_TYPE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DocumentValidationReportJsonWriter
public DocumentValidationReportJsonWriter()
-
-
Method Detail
-
writeEntityBody
protected void writeEntityBody(DocumentValidationReport report, 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<DocumentValidationReport>
- Parameters:
report
- The Java entity.jg
- AJsonGenerator
ready to write your entity as Json.- Throws:
IOException
-
-