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 Summary

      • Fields inherited from class java.io.FilterWriter

        out
      • Fields inherited from class java.io.Writer

        lock
    • Constructor Summary

      Constructors 
      Constructor Description
      IndentingWriter​(java.io.Writer out)  
      IndentingWriter​(java.io.Writer out, boolean doSpace, boolean doNewline)  
    • 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
        Newline indenting writer.
        Returns:
        the indenting writer
        Throws:
        java.io.IOException - the io exception
      • checkAfterNewline

        protected void checkAfterNewline()
                                  throws java.io.IOException
        Check after newline.
        Throws:
        java.io.IOException - the io exception
      • push

        public IndentingWriter push()
        Push indenting writer.
        Returns:
        the indenting writer
      • pop

        public IndentingWriter pop()
        Pop indenting writer.
        Returns:
        the indenting writer
      • space

        public IndentingWriter space()
                              throws java.io.IOException
        Space indenting writer.
        Returns:
        the indenting writer
        Throws:
        java.io.IOException - the io exception
      • 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