public class TextReplacer
extends java.io.Reader
Constructor and Description |
---|
TextReplacer(java.util.Map<java.lang.String,java.lang.String> fields,
java.io.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(java.lang.String[] args)
Usage: TextReplacer filename key=val [key=val] ...
|
int |
read() |
int |
read(char[] buf) |
int |
read(char[] buf,
int offset,
int len) |
java.lang.String |
readLine() |
boolean |
ready() |
java.lang.String |
replace(java.lang.String input)
Replace all settings variables with their values.
|
long |
skip(long val) |
public TextReplacer(java.util.Map<java.lang.String,java.lang.String> fields, java.io.Reader input) throws java.io.IOException
fields
- The map from variable keys to output values.input
- The input Reader to be filtered.java.io.IOException
public java.lang.String readLine() throws java.io.IOException
java.io.IOException
public boolean ready() throws java.io.IOException
ready
in class java.io.Reader
java.io.IOException
public int read() throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public long skip(long val) throws java.io.IOException
skip
in class java.io.Reader
java.io.IOException
public int read(char[] buf) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public int read(char[] buf, int offset, int len) throws java.io.IOException
read
in class java.io.Reader
java.io.IOException
public java.lang.String replace(java.lang.String input)
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Reader
java.io.IOException