Class JsonFormat.PrettyTextGenerator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean atStartOfLine  
      private java.lang.StringBuilder indent  
      private java.lang.Appendable output  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private PrettyTextGenerator​(java.lang.Appendable output)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void indent()
      Indent text by two spaces.
      void outdent()
      Reduces the current indent level by two spaces, or crashes if the indent level is zero.
      void print​(java.lang.CharSequence text)
      Print text to the output stream.
      private void write​(java.lang.CharSequence data)  
      • Methods inherited from class java.lang.Object

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

      • output

        private final java.lang.Appendable output
      • indent

        private final java.lang.StringBuilder indent
      • atStartOfLine

        private boolean atStartOfLine
    • Constructor Detail

      • PrettyTextGenerator

        private PrettyTextGenerator​(java.lang.Appendable output)
    • Method Detail

      • indent

        public void indent()
        Indent text by two spaces. After calling Indent(), two spaces will be inserted at the beginning of each line of text. Indent() may be called multiple times to produce deeper indents.
        Specified by:
        indent in interface JsonFormat.TextGenerator
      • outdent

        public void outdent()
        Reduces the current indent level by two spaces, or crashes if the indent level is zero.
        Specified by:
        outdent in interface JsonFormat.TextGenerator
      • print

        public void print​(java.lang.CharSequence text)
                   throws java.io.IOException
        Print text to the output stream.
        Specified by:
        print in interface JsonFormat.TextGenerator
        Throws:
        java.io.IOException
      • write

        private void write​(java.lang.CharSequence data)
                    throws java.io.IOException
        Throws:
        java.io.IOException