public class LineOrientedInterpolatingReader extends 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 and Description |
---|---|
static String |
DEFAULT_END_DELIM |
static String |
DEFAULT_ESCAPE_SEQ |
static String |
DEFAULT_START_DELIM |
in
Constructor and Description |
---|
LineOrientedInterpolatingReader(Reader reader,
Map<String,?> context)
Filters a Reader using the default escape sequence "\" and token delimiters "${", "}".
|
LineOrientedInterpolatingReader(Reader reader,
Map<String,?> context,
String startDelim,
String endDelim)
Filters a Reader using the default escape sequence "\".
|
LineOrientedInterpolatingReader(Reader reader,
Map<String,?> context,
String startDelim,
String endDelim,
String escapeSeq)
Construct an interpolating Reader, specifying token delimiters and the escape sequence.
|
Modifier and Type | Method and Description |
---|---|
int |
read() |
int |
read(char[] cbuf,
int off,
int len) |
long |
skip(long n) |
close, mark, markSupported, ready, reset
public static final String DEFAULT_START_DELIM
public static final String DEFAULT_END_DELIM
public static final String DEFAULT_ESCAPE_SEQ
public LineOrientedInterpolatingReader(Reader reader, Map<String,?> context, String startDelim, String endDelim, 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
- escape sequencepublic LineOrientedInterpolatingReader(Reader reader, Map<String,?> context, String startDelim, 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 int read() throws IOException
read
in class FilterReader
IOException
public int read(char[] cbuf, int off, int len) throws IOException
read
in class FilterReader
IOException
public long skip(long n) throws IOException
skip
in class FilterReader
IOException
Copyright © 2001–2022 The Apache Software Foundation. All rights reserved.