public class LineOrientedInterpolatingReader
extends java.io.FilterReader
When a possible keyword token is recognized (by detecting the starting and ending token delimiters):
A token in the incoming character stream may be escaped by prepending an "escape sequence" which is specified to the constructor. An escaped token is passed through as written, with the escape sequence removed. This allows things which would look like tokens to be read literally rather than interpolated.
InterpolationFilterReader| Modifier and Type | Field | Description |
|---|---|---|
static java.lang.String |
DEFAULT_END_DELIM |
|
static java.lang.String |
DEFAULT_ESCAPE_SEQ |
|
static java.lang.String |
DEFAULT_START_DELIM |
| Constructor | Description |
|---|---|
LineOrientedInterpolatingReader(java.io.Reader reader,
java.util.Map<java.lang.String,?> context) |
Filters a Reader using the default escape sequence "\" and token delimiters "${", "}".
|
LineOrientedInterpolatingReader(java.io.Reader reader,
java.util.Map<java.lang.String,?> context,
java.lang.String startDelim,
java.lang.String endDelim) |
Filters a Reader using the default escape sequence "\".
|
LineOrientedInterpolatingReader(java.io.Reader reader,
java.util.Map<java.lang.String,?> context,
java.lang.String startDelim,
java.lang.String endDelim,
java.lang.String escapeSeq) |
Construct an interpolating Reader, specifying token delimiters and the escape sequence.
|
| Modifier and Type | Method | Description |
|---|---|---|
int |
read() |
|
int |
read(char[] cbuf,
int off,
int len) |
|
long |
skip(long n) |
public static final java.lang.String DEFAULT_START_DELIM
public static final java.lang.String DEFAULT_END_DELIM
public static final java.lang.String DEFAULT_ESCAPE_SEQ
public LineOrientedInterpolatingReader(java.io.Reader reader,
java.util.Map<java.lang.String,?> context,
java.lang.String startDelim,
java.lang.String endDelim,
java.lang.String escapeSeq)
reader - the Reader to be filtered.context - keyword/value pairs for interpolation.startDelim - character sequence which (possibly) begins a token.endDelim - character sequence which ends a token.escapeSeq - public LineOrientedInterpolatingReader(java.io.Reader reader,
java.util.Map<java.lang.String,?> context,
java.lang.String startDelim,
java.lang.String endDelim)
reader - the Reader to be filtered.context - keyword/value pairs for interpolation.startDelim - the character sequence which (possibly) begins a token.endDelim - the character sequence which ends a token.public LineOrientedInterpolatingReader(java.io.Reader reader,
java.util.Map<java.lang.String,?> context)
reader - the Reader to be filtered.context - keyword/value pairs for interpolation.public int read()
throws java.io.IOException
read in class java.io.FilterReaderjava.io.IOExceptionpublic int read(char[] cbuf,
int off,
int len)
throws java.io.IOException
read in class java.io.FilterReaderjava.io.IOExceptionpublic long skip(long n)
throws java.io.IOException
skip in class java.io.FilterReaderjava.io.IOException