Class DefaultListJsonWriter<EntityType>

    • Constructor Detail

      • DefaultListJsonWriter

        public DefaultListJsonWriter​(String entityType,
                                     Class<EntityType> elClazz)
        Use this constructor if the element of the list are not based on Java generic type.
        Parameters:
        entityType - The list "entity-type".
        elClazz - The class of the element of the list.
      • DefaultListJsonWriter

        public DefaultListJsonWriter​(String entityType,
                                     Class<EntityType> elClazz,
                                     Type elGenericType)
        Use this constructor if the element of the list are based on Java generic type.
        Parameters:
        entityType - The list "entity-type".
        elClazz - The class of the element of the list.
        elGenericType - The generic type of the list (you can use to generate it
    • Method Detail

      • write

        public void write​(List<EntityType> list,
                          com.fasterxml.jackson.core.JsonGenerator jg)
                   throws IOException
        Description copied from class: AbstractJsonWriter
        Implement this method to writes the entity in the provided JsonGenerator.

        This method implementation can use injected properties.

        The JsonGenerator's flushing is done by this abstract class, it's also not not necessary to flush it. Do not close the provided JsonGenerator. It may be used is another marshaller calling this one.

        Specified by:
        write in class AbstractJsonWriter<List<EntityType>>
        Parameters:
        list - The entity to marshall as Json.
        jg - The JsonGenerator used to produce Json output.
        Throws:
        IOException
      • extend

        protected void extend​(List<EntityType> list,
                              com.fasterxml.jackson.core.JsonGenerator jg)
                       throws IOException
        Override this method to write additional information in the list.
        Parameters:
        list - The list to marshal.
        jg - The JsonGenerator which point inside the list object at the end of standard properties.
        Throws:
        IOException
        Since:
        7.2