@Setup(mode=SINGLETON, priority=2000) public class NuxeoGroupJsonWriter extends ExtensibleEntityJsonWriter<NuxeoGroup>
NuxeoGroup
to Json.
This marshaller is enrichable: register class implementing AbstractJsonEnricher
and managing
NuxeoGroup
.
This marshaller is also extensible: extend it and simply override
ExtensibleEntityJsonWriter#extend(NuxeoGroup, JsonWriter)
.
Format is:
{ "entity-type":"group", "groupname": "GROUP_NAME", <- deprecated, for backward compatibility "grouplabel": "GROUP_DISPLAY_NAME", <- deprecated, for backward compatibility "id": "GROUP_NAME", "properties":{ <- depending on the group schema / format is managed by {@link DocumentPropertyJsonWriter} "groupname":"GROUP_NAME", "grouplabel":"GROUP_DISPLAY_NAME", "description": "GROUP_DESCRIPTION" }, "memberUsers": [ "USERNAME1", "USERNAME2", ... ], "memberGroups": [ "GROUPNAME1", "GROUPNAME2", ... ], "parentGroups": [ "GROUPNAME1", "GROUPNAME2", ... ] <-- contextParameters if there are enrichers activated <-- additional property provided by extend() method }
Modifier and Type | Field and Description |
---|---|
static String |
ENTITY_TYPE |
static String |
GROUP_LABEL_COMPATIBILITY_FIELD |
static String |
GROUP_NAME_COMPATIBILITY_FIELD |
static String |
MEMBER_GROUPS_FETCH_PROPERTY |
static String |
MEMBER_USERS_FETCH_PROPERTY |
static String |
PARENT_GROUPS_FETCH_PROPERTY |
ctx, registry
Constructor and Description |
---|
NuxeoGroupJsonWriter() |
Modifier and Type | Method and Description |
---|---|
protected void |
writeEntityBody(NuxeoGroup group,
com.fasterxml.jackson.core.JsonGenerator jg)
Implement this method to write the entity body.
|
protected void |
writeMemberGroups(NuxeoGroup group,
com.fasterxml.jackson.core.JsonGenerator jg) |
protected void |
writeMemberUsers(NuxeoGroup group,
com.fasterxml.jackson.core.JsonGenerator jg) |
protected void |
writeParentGroups(NuxeoGroup group,
com.fasterxml.jackson.core.JsonGenerator jg) |
protected void |
writeProperties(NuxeoGroup group,
com.fasterxml.jackson.core.JsonGenerator jg) |
extend, write
accept, getGenerator, write, writeEntity, writeEntity, writeEntityField, writeSerializable, writeSerializableField, writeSerializableListField, writeSerializableMapField
public static final String ENTITY_TYPE
public static final String MEMBER_USERS_FETCH_PROPERTY
public static final String MEMBER_GROUPS_FETCH_PROPERTY
public static final String PARENT_GROUPS_FETCH_PROPERTY
public static final String GROUP_NAME_COMPATIBILITY_FIELD
public static final String GROUP_LABEL_COMPATIBILITY_FIELD
public NuxeoGroupJsonWriter()
protected void writeEntityBody(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException
ExtensibleEntityJsonWriter
writeEntityBody
in class ExtensibleEntityJsonWriter<NuxeoGroup>
group
- The Java entity.jg
- A JsonGenerator
ready to write your entity as Json.IOException
protected void writeProperties(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException
IOException
protected void writeMemberUsers(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException
IOException
protected void writeMemberGroups(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException
IOException
protected void writeParentGroups(NuxeoGroup group, com.fasterxml.jackson.core.JsonGenerator jg) throws IOException
IOException
Copyright © 2018 Nuxeo. All rights reserved.