org.apache.commons.io.input

## Class AbstractCharacterFilterReader

- java.lang.Object
- - java.io.Reader
  - - java.io.FilterReader
    - - org.apache.commons.io.input.AbstractCharacterFilterReader

- All Implemented Interfaces:
    Closeable, AutoCloseable, Readable
  Direct Known Subclasses:
    CharacterFilterReader, CharacterSetFilterReader

      public abstract class AbstractCharacterFilterReader
      extends FilterReader

  A filter reader that filters out characters where subclasses decide which characters to filter out.

- - ### Field Summary

    - ### Fields inherited from class java.io.FilterReader

      `in`

    - ### Fields inherited from class java.io.Reader

      `lock`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `AbstractCharacterFilterReader(Reader reader)` Constructs a new reader.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract boolean` | `filter(int ch)` Returns true if the given character should be filtered out, false to keep the character.
    `int` | `read()`
    `int` | `read(char[] cbuf, int off, int len)`

    - ### Methods inherited from class java.io.FilterReader

      `close, mark, markSupported, ready, reset, skip`

    - ### Methods inherited from class java.io.Reader

      `read, read`

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

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

- - ### Constructor Detail

    - #### AbstractCharacterFilterReader

          protected AbstractCharacterFilterReader(Reader reader)

      Constructs a new reader.
      Parameters:
        `reader` - the reader to filter

  - ### Method Detail

    - #### read

          public int read()
                   throws IOException

      Overrides:
        `read` in class `FilterReader`
      Throws:
        `IOException`

    - #### filter

          protected abstract boolean filter(int ch)

      Returns true if the given character should be filtered out, false to keep the character.
      Parameters:
        `ch` - the character to test.
      Returns:
        true if the given character should be filtered out, false to keep the character.

    - #### read

          public int read(char[] cbuf,
                          int off,
                          int len)
                   throws IOException

      Overrides:
        `read` in class `FilterReader`
      Throws:
        `IOException`

Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.