@Setup(mode=SINGLETON, priority=2000) public class SchemaJsonWriter extends ExtensibleEntityJsonWriter<Schema>
Schema
to Json.
This marshaller is enrichable: register class implementing AbstractJsonEnricher
and managing Schema
.
This marshaller is also extensible: extend it and simply override
ExtensibleEntityJsonWriter#extend(Schema, JsonWriter)
.
Format is:
{ "entity-type":"schema", "name": "SCHEMA_NAME", "prefix: "SCHEMA_PREFIX", <- only if there's a prefix "fields", { "PRIMITIVE_FIELD_LOCAL_NAME": "FIELD_TYPE", <- where field type is {@link Type#getName()} (string, boolean, integer, ...) "PRIMITIVE_LIST_LOCAL_NAME": "FIELD_TYPE[]" <- where field type is {@link Type#getName()} (string, boolean, integer, ...) "COMPLEX_FIELD_LOCAL_NAME" : { "type": "complex", "fields": { loop the same format } }, "COMPLEX_LIST_FIELD_LOCAL_NAME" : { "type": "complex[]", "fields": { loop the same format } }, "CONTENT_FIELD": "blob", "CONTENT_LIST_FIELD": "blob[]", ... } <-- contextParameters if there are enrichers activated <-- additional property provided by extend() method }
Modifier and Type | Field and Description |
---|---|
static String |
ENTITY_TYPE |
Constructor and Description |
---|
SchemaJsonWriter() |
write
accept, write
public static final String ENTITY_TYPE
Copyright © 2015 Nuxeo SA. All rights reserved.