|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.openjpa.persistence.jest.TokenReplacedStream
public class TokenReplacedStream
Reads from an input stream and writes to an output stream after replacing matched tokens by their counterpart.
Nested Class Summary | |
---|---|
static class |
TokenReplacedStream.Pattern
|
Constructor Summary | |
---|---|
TokenReplacedStream()
|
Method Summary | |
---|---|
(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. |
(package private) void |
reset(TokenReplacedStream.Pattern... patterns)
Resets all the patterns. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TokenReplacedStream()
Method Detail |
---|
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.
IOException
int match(char c, TokenReplacedStream.Pattern... patterns)
c
- a character to matchpatterns
- an array of patterns
TokenReplacedStream.Pattern matched(TokenReplacedStream.Pattern... patterns)
patterns
-
void reset(TokenReplacedStream.Pattern... patterns)
patterns
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |