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.IOExceptionpublic java.lang.String readLine()
throws java.io.IOException
java.io.IOExceptionpublic boolean ready()
throws java.io.IOException
ready in class java.io.Readerjava.io.IOExceptionpublic int read()
throws java.io.IOException
read in class java.io.Readerjava.io.IOExceptionpublic long skip(long val)
throws java.io.IOException
skip in class java.io.Readerjava.io.IOExceptionpublic int read(char[] buf)
throws java.io.IOException
read in class java.io.Readerjava.io.IOExceptionpublic int read(char[] buf,
int offset,
int len)
throws java.io.IOException
read in class java.io.Readerjava.io.IOExceptionpublic java.lang.String replace(java.lang.String input)
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exceptionpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseableclose in class java.io.Readerjava.io.IOException