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.
      void println()  
      void println​(java.lang.CharSequence text)  
      void printSubsequence​(java.lang.CharSequence text, int start, int end)  
      • 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
      • printSubsequence

        public void printSubsequence​(java.lang.CharSequence text,
                                     int start,
                                     int end)
                              throws java.io.IOException
        Specified by:
        printSubsequence in interface JsonFormat.TextGenerator
        Throws:
        java.io.IOException
      • println

        public void println​(java.lang.CharSequence text)
                     throws java.io.IOException
        Specified by:
        println in interface JsonFormat.TextGenerator
        Throws:
        java.io.IOException