java.lang.Object
|
+--java.io.Reader
|
+--java.io.BufferedReader
|
+--BracketFilteredReader
This extension of BufferedReader reads a given
Reader linewisely and substitutes any bracket by a dot,
if it occurs within a Java comment, a Java String literal,
or a Java char literal, see
Java
Language Specification - Lexical Structure.
It is only allowed to call readLine() for reading
the given Reader, and this is the only method
with behaviour different to BufferedReader.
readLine(),
brackets,
replaceChar| Field Summary | |
static char[] |
brackets
The (bracket) characters to be substituted by replaceChar, if they do occur
within a char or string literal, or within a comment. |
static char |
replaceChar
The character to substitute (bracket) characters brackets, if they do occur
within a char or string literal, or within a comment. |
| Constructor Summary | |
BracketFilteredReader(Reader r)
Initializes this BracketFilteredReader. |
|
| Method Summary | |
static void |
main(String[] args)
Filters args[0] to targetfile args[0]+".out". |
int |
read()
Please use readLine() instead. |
int |
read(char[] cbuf,
int off,
int len)
Please use readLine() instead. |
String |
readLine()
Reads the next line from this reader and replaces any bracket character within comments or literals by a dot. |
| Methods inherited from class java.io.BufferedReader |
close, mark, markSupported, ready, reset, skip |
| Methods inherited from class java.io.Reader |
read |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final char[] brackets
replaceChar, if they do occur
within a char or string literal, or within a comment.
replaceCharpublic static final char replaceChar
brackets, if they do occur
within a char or string literal, or within a comment.
brackets,
Constant Field Values| Constructor Detail |
public BracketFilteredReader(Reader r)
BufferedReader.BufferedReader(Reader)| Method Detail |
public int read()
throws UnsupportedOperationException
readLine() instead.
read in class BufferedReaderUnsupportedOperationException - everytime
public int read(char[] cbuf,
int off,
int len)
throws UnsupportedOperationException
readLine() instead.
read in class BufferedReaderUnsupportedOperationException - everytime
public String readLine()
throws IOException,
IllegalStateException
readLine in class BufferedReaderIOException - if super.readLine() throws one
IllegalStateException - if syntax errors occur, such as
IllegalStateException is not
thrown, if a character literal is not properly built.public static void main(String[] args)
args[0] to targetfile args[0]+".out".
args - component zero yields the input for this run of the filter