Class ExtensibleEntityJsonWriter<EntityType>

    • Method Detail

      • write

        public void write​(EntityType entity,
                          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<EntityType>
        Parameters:
        entity - The entity to marshall as Json.
        jg - The JsonGenerator used to produce Json output.
        Throws:
        IOException
      • writeEntityBody

        protected abstract void writeEntityBody​(EntityType entity,
                                                com.fasterxml.jackson.core.JsonGenerator jg)
                                         throws IOException
        Implement this method to write the entity body.
        Parameters:
        entity - The Java entity.
        jg - A JsonGenerator ready to write your entity as Json.
        Throws:
        IOException
        Since:
        7.2
      • extend

        protected void extend​(EntityType entity,
                              com.fasterxml.jackson.core.JsonGenerator jg)
                       throws IOException
        Override this method to add additional property in the entity. This method is useful to override a marshaller implementing this class.
        Parameters:
        entity - The Java entity.
        jg - A JsonGenerator ready to write your entity as Json.
        Throws:
        IOException
        Since:
        7.2