Package rs.baselib.io
Class AbstractReaderFilter
java.lang.Object
java.io.Reader
java.io.FilterReader
rs.baselib.io.AbstractReaderFilter
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
- Direct Known Subclasses:
XmlReaderFilter
Abstract implementation of a reader that can filter characters.
Descendants shall override isValidChar(char)
only.
- Author:
- ralph
-
Field Summary
Fields inherited from class java.io.FilterReader
in
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
isValidChar
(char c) Tells the filter reader whether the given character is valid or not.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
nullReader, read, read, transferTo
-
Constructor Details
-
AbstractReaderFilter
Constructor.- Parameters:
in
- - the underlying reader
-
-
Method Details
-
read
- Overrides:
read
in classFilterReader
- Throws:
IOException
-
read
- Overrides:
read
in classFilterReader
- Throws:
IOException
-
isValidChar
public abstract boolean isValidChar(char c) Tells the filter reader whether the given character is valid or not.- Parameters:
c
- the character to be validated- Returns:
true
when the character can be delivered
-