Module io.ebean.api

Interface JsonWriter


public interface JsonWriter
Wraps an underlying JsonGenerator taking into account null suppression and exposing isIncludeEmpty() etc.
  • Method Details

    • gen

      com.fasterxml.jackson.core.JsonGenerator gen()
      Return the Jackson core JsonGenerator.
    • isIncludeNull

      boolean isIncludeNull()
      Return true if null values should be included in JSON output.
    • isIncludeEmpty

      boolean isIncludeEmpty()
      Return true if empty collections should be included in the JSON output.
    • writeStartObject

      void writeStartObject(String key)
      Write a field name followed by object start.
    • writeStartObject

      void writeStartObject()
      Write a object start.
    • writeEndObject

      void writeEndObject()
      Write a object end.
    • writeStartArray

      void writeStartArray(String key)
      Write a field name followed by array start.
    • writeStartArray

      void writeStartArray()
      Write a array start.
    • writeEndArray

      void writeEndArray()
      Write a array end.
    • writeFieldName

      void writeFieldName(String name)
      Write the field name.
    • writeNullField

      void writeNullField(String name)
      Write a null value taking into account null value suppression.
    • writeNumberField

      void writeNumberField(String name, int value)
      Write a number field.
    • writeNumberField

      void writeNumberField(String name, short value)
      Write a number field.
    • writeNumberField

      void writeNumberField(String name, long value)
      Write a number field.
    • writeNumberField

      void writeNumberField(String name, double value)
      Write a number field.
    • writeNumberField

      void writeNumberField(String name, float value)
      Write a number field.
    • writeNumberField

      void writeNumberField(String name, BigDecimal value)
      Write a number field.
    • writeStringField

      void writeStringField(String name, String value)
      Write a sting field.
    • writeBinary

      void writeBinary(InputStream is, int length)
      Write a binary field.
    • writeBinaryField

      void writeBinaryField(String name, byte[] value)
      Write a binary field.
    • writeBooleanField

      void writeBooleanField(String name, boolean value)
      Write a boolean field.
    • writeBoolean

      void writeBoolean(boolean value)
      Write a boolean value (typically inside a list).
    • writeString

      void writeString(String value)
      Write a string value (typically inside a list).
    • writeNumber

      void writeNumber(int value)
      Write a int value (typically inside a list).
    • writeNumber

      void writeNumber(long value)
      Write a long value (typically inside a list).
    • writeNumber

      void writeNumber(double value)
      Write a double value.
    • writeNumber

      void writeNumber(BigDecimal value)
      Write a BigDecimal value (typically inside a list).
    • writeNull

      void writeNull()
      Write a null value.
    • writeRaw

      void writeRaw(String text)
      Method that will force generator to copy input text verbatim with no modifications (including that no escaping is done and no separators are added even if context [array, object] would otherwise require such). If such separators are desired, use writeRawValue(String) instead.
    • writeRawValue

      void writeRawValue(String text)
      Method that will force generator to copy input text verbatim without any modifications, but assuming it must constitute a single legal JSON value (number, string, boolean, null, Array or List). Assuming this, proper separators are added if and as needed (comma or colon), and generator state updated to reflect this.