Package org.codehaus.janino.util

# Class AutoIndentWriter

java.lang.Object
java.io.Writer
java.io.FilterWriter
org.codehaus.janino.util.AutoIndentWriter

All Implemented Interfaces:
  `Closeable`, `Flushable`, `Appendable`, `AutoCloseable`

public class AutoIndentWriter extends FilterWriter
A `FilterWriter` that indents lines by processing some control characters in the character stream.

`INDENT` or `UNINDENT` may precede lines and indicate that the line and all following lines should be (un)indented by one position.

`TABULATOR`s may appear anywhere in lines and dictate that portions of all following lines should be vertically aligned (see `resolveTabs(List)`).

## Field Summary

Fields
Modifier and Type
Field
Description
`static final char`
`CLEAR_TABULATORS`
Special character at the beginning of a line that flushes a tabular layout.
`static final char`
`INDENT`
Special character at the beginning of a line that indents the following text by one position.
`static final char`
`TABULATOR`
Special character indicating a tabular layout of all following lines until `UNINDENT`.
`static final char`
`UNINDENT`
Special character at the beginning of a line that unindents the following text by one position.

### Fields inherited from class java.io.FilterWriter

`out`

### Fields inherited from class java.io.Writer

`lock`

## Constructor Summary

Constructors
Constructor
Description
`AutoIndentWriter(Writer out)`

## Method Summary

Modifier and Type
Method
Description
`void`
`close()`
`void`
`flush()`
`void`
`write(char[] cbuf, int off, int len)`
`void`
`write(int c)`
`void`
`write(String str, int off, int len)`

### Methods inherited from class java.io.Writer

`append, append, append, nullWriter, write, write`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### TABULATOR

public static final char TABULATOR
Special character indicating a tabular layout of all following lines until `UNINDENT`.

See Also:
  - Constant Field Values

### CLEAR_TABULATORS

public static final char CLEAR_TABULATORS
Special character at the beginning of a line that flushes a tabular layout.

See Also:
  - Constant Field Values

### INDENT

public static final char INDENT
Special character at the beginning of a line that indents the following text by one position.

See Also:
  - Constant Field Values

### UNINDENT

public static final char UNINDENT
Special character at the beginning of a line that unindents the following text by one position.

See Also:
  - Constant Field Values

## Constructor Details

### AutoIndentWriter

public AutoIndentWriter(Writer out)

## Method Details

### write

public void write(@Nullable char[] cbuf, int off, int len) throws IOException

Overrides:
  `write` in class `FilterWriter`
Throws:
  `IOException`

### write

public void write(@Nullable String str, int off, int len) throws IOException

Overrides:
  `write` in class `FilterWriter`
Throws:
  `IOException`

### write

public void write(int c) throws IOException

Overrides:
  `write` in class `FilterWriter`
Throws:
  `IOException`

### close

public void close() throws IOException

Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in interface `Closeable`
Overrides:
  `close` in class `FilterWriter`
Throws:
  `IOException`

### flush

public void flush() throws IOException

Specified by:
  `flush` in interface `Flushable`
Overrides:
  `flush` in class `FilterWriter`
Throws:
  `IOException`