Interface JsonSink<S extends JsonSink<S>>

Type Parameters:
S - A subclass of JsonSink.
All Known Implementing Classes:
JsonAppendableWriter, JsonBuilder, JsonStringWriter

public interface JsonSink<S extends JsonSink<S>>
  • Method Summary

    Modifier and Type
    Method
    Description
    Starts an array.
    Starts an array within an object, prefixed with a key.
    array(String key, Collection<?> c)
    Emits the start of an array with a key.
    Emits the start of an array.
    end()
    Ends the current array or object.
    nul()
    Emits a 'null' token.
    nul(String key)
    Emits a 'null' token with a key.
    Starts an object.
    Starts an object within an object, prefixed with a key.
    object(String key, Map<?,?> map)
    Emits the start of an object with a key.
    object(Map<?,?> map)
    Emits the start of an object.
    value(boolean b)
    Emits a boolean value.
    value(double d)
    Emits a double value.
    value(float f)
    Emits a float value.
    value(int i)
    Emits an integer value.
    value(long l)
    Emits a long value.
    Emits a Number value.
    Emits an object if it is a JSON-compatible type, otherwise throws an exception.
    Emits a string value (or null).
    value(String key, boolean b)
    Emits a boolean value with a key.
    value(String key, double d)
    Emits a double value with a key.
    value(String key, float f)
    Emits a float value with a key.
    value(String key, int i)
    Emits an integer value with a key.
    value(String key, long l)
    Emits a long value with a key.
    value(String key, Number n)
    Emits a Number value with a key.
    value(String key, Object o)
    Emits an object with a key if it is a JSON-compatible type, otherwise throws an exception.
    value(String key, String s)
    Emits a string value (or null) with a key.
  • Method Details

    • array

      S array(Collection<?> c)
      Emits the start of an array.
    • array

      S array(String key, Collection<?> c)
      Emits the start of an array with a key.
    • object

      S object(Map<?,?> map)
      Emits the start of an object.
    • object

      S object(String key, Map<?,?> map)
      Emits the start of an object with a key.
    • nul

      S nul()
      Emits a 'null' token.
    • nul

      S nul(String key)
      Emits a 'null' token with a key.
    • value

      S value(Object o)
      Emits an object if it is a JSON-compatible type, otherwise throws an exception.
    • value

      S value(String key, Object o)
      Emits an object with a key if it is a JSON-compatible type, otherwise throws an exception.
    • value

      S value(String s)
      Emits a string value (or null).
    • value

      S value(int i)
      Emits an integer value.
    • value

      S value(long l)
      Emits a long value.
    • value

      S value(boolean b)
      Emits a boolean value.
    • value

      S value(double d)
      Emits a double value.
    • value

      S value(float f)
      Emits a float value.
    • value

      S value(Number n)
      Emits a Number value.
    • value

      S value(String key, String s)
      Emits a string value (or null) with a key.
    • value

      S value(String key, int i)
      Emits an integer value with a key.
    • value

      S value(String key, long l)
      Emits a long value with a key.
    • value

      S value(String key, boolean b)
      Emits a boolean value with a key.
    • value

      S value(String key, double d)
      Emits a double value with a key.
    • value

      S value(String key, float f)
      Emits a float value with a key.
    • value

      S value(String key, Number n)
      Emits a Number value with a key.
    • array

      S array()
      Starts an array.
    • object

      S object()
      Starts an object.
    • array

      S array(String key)
      Starts an array within an object, prefixed with a key.
    • object

      S object(String key)
      Starts an object within an object, prefixed with a key.
    • end

      S end()
      Ends the current array or object.