Interface JsonWriter


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

      • 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.
      • writeNullField

        void writeNullField​(String name)
        Write a null value taking into account null value suppression.
      • 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.