public class TextReplacer extends Reader
| Constructor and Description |
|---|
TextReplacer(Map<String,String> fields,
Reader input)
Create an object where we'll filter an input stream
replacing variables with values.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static void |
main(String[] args)
Usage: TextReplacer filename key=val [key=val] ...
|
int |
read() |
int |
read(char[] buf) |
int |
read(char[] buf,
int offset,
int len) |
String |
readLine() |
boolean |
ready() |
String |
replace(String input)
Replace all settings variables with their values.
|
long |
skip(long val) |
mark, markSupported, read, resetpublic TextReplacer(Map<String,String> fields, Reader input) throws IOException
fields - The map from variable keys to output values.input - The input Reader to be filtered.IOExceptionpublic String readLine() throws IOException
IOExceptionpublic boolean ready()
throws IOException
ready in class ReaderIOExceptionpublic int read()
throws IOException
read in class ReaderIOExceptionpublic long skip(long val)
throws IOException
skip in class ReaderIOExceptionpublic int read(char[] buf)
throws IOException
read in class ReaderIOExceptionpublic int read(char[] buf,
int offset,
int len)
throws IOException
read in class ReaderIOExceptionpublic String replace(String input)
public static void main(String[] args) throws Exception
Exceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableclose in class ReaderIOException