|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jmatchparser.util.ExpectString
public class ExpectString
A class that can "expect" parts at the start or end of a string, and get/set
the remaining part (rest). In most cases, ExpectReader
is more
flexible, but sometimes this class might be more handy.
Constructor Summary | |
---|---|
ExpectString(String rest)
Create a new expect string |
Method Summary | |
---|---|
String |
changeRest(String newRest)
Change the rest that has not yet been parsed, and return the old rest. |
void |
expect(String start)
Expect a fixed string at the beginning. |
void |
expectEnd(String end)
Expect a fixed string at the end. |
List<Matcher> |
expectMultiRegexMatch(Pattern pattern,
int restGroup)
Match the given regex more than once against the rest. |
List<Matcher> |
expectMultiRegexMatch(String regex,
int restGroup)
Match the given regex more than once against the rest. |
Matcher |
expectRegex(Pattern pattern,
int keptGroup)
Expect a regex that matches the complete string. |
Matcher |
expectRegex(String regex)
Expect a regex at the begin of the string and return a matcher for it. |
Matcher |
expectRegex(String pattern,
int keptGroup)
Expect a regex that matches the complete string. |
String |
expectStringAfterString(String s)
Expect some fixed string followed by some variable text at the end of the rest. |
String |
expectStringBeforeString(String s)
Expect some variable text before some fixed string. |
String |
getRest()
Return the rest that has not yet been parsed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ExpectString(String rest)
rest
- The rest still to be matchedMethod Detail |
---|
public String getRest()
public String changeRest(String newRest)
public String expectStringBeforeString(String s)
s
- the fixed string
public String expectStringAfterString(String s)
s
- the fixed string
public void expect(String start)
public void expectEnd(String end)
public Matcher expectRegex(String regex)
public Matcher expectRegex(String pattern, int keptGroup)
public Matcher expectRegex(Pattern pattern, int keptGroup)
public List<Matcher> expectMultiRegexMatch(String regex, int restGroup)
ExpectReader.ensureMultiRegexMatch(String, Pattern, Pattern, int)
public List<Matcher> expectMultiRegexMatch(Pattern pattern, int restGroup)
ExpectReader.ensureMultiRegexMatch(String, Pattern, Pattern, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |