public class TokenReplacedStream extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TokenReplacedStream.Pattern |
| Constructor and Description |
|---|
TokenReplacedStream() |
| Modifier and Type | Method and Description |
|---|---|
(package private) int |
match(char c,
TokenReplacedStream.Pattern... patterns)
Match the given character to all patterns and return the index of highest match.
|
(package private) TokenReplacedStream.Pattern |
matched(TokenReplacedStream.Pattern... patterns)
Gets the pattern if any in matched state
|
void |
replace(InputStream in,
Writer out,
String... prs)
Read the given input stream and replaces the tokens as it reads.
|
void |
replace(Reader in,
Writer out,
String... prs) |
(package private) void |
reset(TokenReplacedStream.Pattern... patterns)
Resets all the patterns.
|
public void replace(InputStream in, Writer out, String... prs) throws IOException
in - a non-null input streamout - a character oriented writerreplacements - an even number of Strings. Any occurrence of the even-indexed i-th String in the
input stream will be replaced by the (i+1)-th String in the output writer.IOExceptionpublic void replace(Reader in, Writer out, String... prs) throws IOException
IOExceptionint match(char c,
TokenReplacedStream.Pattern... patterns)
c - a character to matchpatterns - an array of patternsTokenReplacedStream.Pattern matched(TokenReplacedStream.Pattern... patterns)
patterns - void reset(TokenReplacedStream.Pattern... patterns)
patterns - Copyright © 2006–2015 Apache Software Foundation. All rights reserved.