Class JSONEncoder


  • public class JSONEncoder
    extends Encoder<java.lang.Object>
    JSON encoder.
    • Constructor Summary

      Constructors 
      Constructor Description
      JSONEncoder()
      Constructs a new JSON encoder.
      JSONEncoder​(boolean compact)
      Constructs a new JSON encoder.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void write​(java.lang.Object value, java.io.Writer writer)
      Writes a value to a character stream.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • JSONEncoder

        public JSONEncoder()
        Constructs a new JSON encoder.
      • JSONEncoder

        public JSONEncoder​(boolean compact)
        Constructs a new JSON encoder.
        Parameters:
        compact - true if the encoded output should be compact; false, otherwise.
    • Method Detail

      • write

        public void write​(java.lang.Object value,
                          java.io.Writer writer)
                   throws java.io.IOException
        Description copied from class: Encoder
        Writes a value to a character stream.
        Specified by:
        write in class Encoder<java.lang.Object>
        Parameters:
        value - The value to encode.
        writer - The character stream to write to.
        Throws:
        java.io.IOException - If an exception occurs.