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, reset
public 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.IOException
public String readLine() throws IOException
IOException
public boolean ready() throws IOException
ready
in class Reader
IOException
public int read() throws IOException
read
in class Reader
IOException
public long skip(long val) throws IOException
skip
in class Reader
IOException
public int read(char[] buf) throws IOException
read
in class Reader
IOException
public int read(char[] buf, int offset, int len) throws IOException
read
in class Reader
IOException
public String replace(String input)
public static void main(String[] args) throws Exception
Exception
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
close
in class Reader
IOException