Class EntityListWriter<T>

    • Constructor Detail

      • EntityListWriter

        public EntityListWriter()
    • Method Detail

      • getEntityType

        protected abstract String getEntityType()
        Returns the entity-type value of the list (ie: users, groups....)
        Specified by:
        getEntityType in class EntityWriter<List<T>>
        Returns:
        the string representing the entity-type.
      • writeItem

        protected abstract void writeItem​(com.fasterxml.jackson.core.JsonGenerator jg,
                                          T item)
                                   throws IOException
        Writes the item in a JsonGenerator.
        Throws:
        IOException
      • isWriteable

        public boolean isWriteable​(Class<?> type,
                                   Type genericType,
                                   Annotation[] annotations,
                                   javax.ws.rs.core.MediaType mediaType)
        Specified by:
        isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<T>
        Overrides:
        isWriteable in class EntityWriter<List<T>>
      • writeEntityBody

        protected void writeEntityBody​(com.fasterxml.jackson.core.JsonGenerator jg,
                                       List<T> list)
                                throws IOException
        Description copied from class: EntityWriter
        Write the body of the entity. The object has already been opened and it entity-type rendered.
        Specified by:
        writeEntityBody in class EntityWriter<List<T>>
        Throws:
        IOException
      • writePaginableHeader

        protected void writePaginableHeader​(com.fasterxml.jackson.core.JsonGenerator jg,
                                            List<T> list)
                                     throws IOException
        Throws:
        IOException
      • writeHeader

        protected void writeHeader​(com.fasterxml.jackson.core.JsonGenerator jg,
                                   List<T> list)
                            throws IOException
        Override this method to write into list header
        Throws:
        IOException