public abstract class EntityListWriter<T> extends EntityWriter<List<T>>
getEntityType()
and writeItem(JsonGenerator, Object)
factory
Constructor and Description |
---|
EntityListWriter() |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
getEntityType()
Returns the entity-type value of the list (ie: users, groups....)
|
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
protected void |
writeEntityBody(com.fasterxml.jackson.core.JsonGenerator jg,
List<T> list)
Write the body of the entity.
|
protected void |
writeHeader(com.fasterxml.jackson.core.JsonGenerator jg,
List<T> list)
Override this method to write into list header
|
protected abstract void |
writeItem(com.fasterxml.jackson.core.JsonGenerator jg,
T item)
Writes the item in a JsonGenerator.
|
protected void |
writePaginableHeader(com.fasterxml.jackson.core.JsonGenerator jg,
List<T> list) |
getSize, writeEntity, writeTo
public EntityListWriter()
protected abstract String getEntityType()
getEntityType
in class EntityWriter<List<T>>
protected abstract void writeItem(com.fasterxml.jackson.core.JsonGenerator jg, T item) throws IOException
IOException
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isWriteable
in interface javax.ws.rs.ext.MessageBodyWriter<List<T>>
isWriteable
in class EntityWriter<List<T>>
protected void writeEntityBody(com.fasterxml.jackson.core.JsonGenerator jg, List<T> list) throws IOException
EntityWriter
writeEntityBody
in class EntityWriter<List<T>>
IOException
protected void writePaginableHeader(com.fasterxml.jackson.core.JsonGenerator jg, List<T> list) throws IOException
IOException
protected void writeHeader(com.fasterxml.jackson.core.JsonGenerator jg, List<T> list) throws IOException
IOException
Copyright © 2019 Nuxeo. All rights reserved.