Class IndentingWriter

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.Appendable, java.lang.AutoCloseable

    public class IndentingWriter
    extends java.io.FilterWriter
    • Field Detail

      • indent

        protected final java.lang.StringBuilder indent
      • doSpace

        protected final boolean doSpace
      • doNewline

        protected final boolean doNewline
      • lastWasNewline

        protected boolean lastWasNewline
    • Constructor Detail

      • IndentingWriter

        public IndentingWriter​(java.io.Writer out,
                               boolean doSpace,
                               boolean doNewline)
      • IndentingWriter

        public IndentingWriter​(java.io.Writer out)
    • Method Detail

      • makeIndentingWriter

        public static IndentingWriter makeIndentingWriter​(java.io.Writer writer)
      • newline

        public IndentingWriter newline()
                                throws java.io.IOException
        Throws:
        java.io.IOException
      • checkAfterNewline

        protected void checkAfterNewline()
                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • space

        public IndentingWriter space()
                              throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public void write​(char[] buf)
                   throws java.io.IOException
        Overrides:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • write

        public void write​(char[] buf,
                          int offset,
                          int length)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterWriter
        Throws:
        java.io.IOException
      • write

        public void write​(int c)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterWriter
        Throws:
        java.io.IOException
      • write

        public void write​(java.lang.String s)
                   throws java.io.IOException
        Overrides:
        write in class java.io.Writer
        Throws:
        java.io.IOException
      • write

        public void write​(java.lang.String s,
                          int offset,
                          int length)
                   throws java.io.IOException
        Overrides:
        write in class java.io.FilterWriter
        Throws:
        java.io.IOException