Package: groovy.text.markup

## [Java] Class DelegatingIndentWriter

- groovy.text.markup.DelegatingIndentWriter

-     public class DelegatingIndentWriter
      extends Writer

  A writer which delegates to another writer and supports an additional indenting level.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String` | `SPACES` | Four-space indentation unit.
    `static String` | `TAB` | Tab indentation unit.

  - ### Constructor Summary

    Constructors
    Constructor and description
    `DelegatingIndentWriter(Writer delegate)` Creates an indenting writer that uses SPACES for each indentation level.
    `DelegatingIndentWriter(Writer delegate, String indentString)` Creates an indenting writer that delegates output to another writer.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public Writer` | `append(CharSequence csq)` {@inheritDoc}
    `` | `public Writer` | `append(CharSequence csq, int start, int end)` {@inheritDoc}
    `` | `public Writer` | `append(char c)` {@inheritDoc}
    `` | `public void` | `close()` {@inheritDoc}
    `` | `public void` | `flush()` {@inheritDoc}
    `` | `public int` | `next()` Increases the current indentation level.
    `` | `public int` | `previous()` Decreases the current indentation level.
    `` | `public void` | `write(int c)` {@inheritDoc}
    `` | `public void` | `write(char[] cbuf)` {@inheritDoc}
    `` | `public void` | `write(char[] cbuf, int off, int len)` {@inheritDoc}
    `` | `public void` | `write(String str)` {@inheritDoc}
    `` | `public void` | `write(String str, int off, int len)` {@inheritDoc}
    `` | `public void` | `writeIndent()` Writes the current indentation prefix to the delegate writer.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Writer` | `append, append, append, append, append, append, close, equals, flush, getClass, hashCode, notify, notifyAll, nullWriter, toString, wait, wait, wait, write, write, write, write, write`

- - ### Field Detail

    - #### public static final String SPACES

      Four-space indentation unit.

    - #### public static final String TAB

      Tab indentation unit.

  - ### Constructor Detail

    - #### public DelegatingIndentWriter(Writer delegate)

      Creates an indenting writer that uses SPACES for each indentation level.

      Parameters:
        `delegate` - writer that receives the rendered output

    - #### public DelegatingIndentWriter(Writer delegate, String indentString)

      Creates an indenting writer that delegates output to another writer.

      Parameters:
        `delegate` - writer that receives the rendered output
        `indentString` - indentation unit written for each nesting level

  - ### Method Detail

    - #### public Writer append(CharSequence csq)

      {@inheritDoc}

    - #### public Writer append(CharSequence csq, int start, int end)

      {@inheritDoc}

    - #### public Writer append(char c)

      {@inheritDoc}

    - #### public void close()

      {@inheritDoc}

    - #### public void flush()

      {@inheritDoc}

    - #### public int next()

      Increases the current indentation level.

      Returns:
        the new indentation level

    - #### public int previous()

      Decreases the current indentation level.

      Returns:
        the new indentation level

    - #### public void write(int c)

      {@inheritDoc}

    - #### public void write(char[] cbuf)

      {@inheritDoc}

    - #### public void write(char[] cbuf, int off, int len)

      {@inheritDoc}

    - #### public void write(String str)

      {@inheritDoc}

    - #### public void write(String str, int off, int len)

      {@inheritDoc}

    - #### public void writeIndent()

      Writes the current indentation prefix to the delegate writer.

      throws:
        IOException if writing the indentation fails