public class InterpolationFilterReader
extends java.io.FilterReader
When a possible keyword token is recognized (by detecting the starting and ending token delimiters):
s| Constructor | Description |
|---|---|
InterpolationFilterReader(java.io.Reader in,
java.util.Map<?,java.lang.Object> variables,
java.lang.String beginToken,
java.lang.String endToken) |
Construct a Reader to interpolate values enclosed between the given delimiter tokens.
|
InterpolationFilterReader(java.io.Reader in,
java.util.Map<java.lang.String,java.lang.Object> variables) |
Construct a Reader using the default interpolation delimiter tokens "${" and "}".
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
read() |
Returns the next character in the filtered stream, replacing tokens from the original stream.
|
int |
read(char[] cbuf,
int off,
int len) |
Reads characters into a portion of an array.
|
long |
skip(long n) |
Skips characters.
|
public InterpolationFilterReader(java.io.Reader in,
java.util.Map<?,java.lang.Object> variables,
java.lang.String beginToken,
java.lang.String endToken)
in - a Reader to be wrapped for interpolation.variables - name/value pairs to be interpolated into the character stream.beginToken - an interpolation target begins with this.endToken - an interpolation target ends with this.public InterpolationFilterReader(java.io.Reader in,
java.util.Map<java.lang.String,java.lang.Object> variables)
in - a Reader to be wrapped for interpolation.variables - name/value pairs to be interpolated into the character stream.public long skip(long n)
throws java.io.IOException
skip in class java.io.FilterReadern - The number of characters to skipjava.lang.IllegalArgumentException - If n is negative.java.io.IOException - If an I/O error occurspublic int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
read in class java.io.FilterReadercbuf - Destination buffer to write characters to. Must not be null.off - Offset at which to start storing characters.len - Maximum number of characters to read.java.io.IOException - If an I/O error occurspublic int read()
throws java.io.IOException
read in class java.io.FilterReaderjava.io.IOException - if the underlying stream throws an IOException during reading