|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.batch.support.PatternMatcher<S>
public class PatternMatcher<S>
Constructor Summary | |
---|---|
PatternMatcher(Map<String,S> map)
Initialize a new PatternMatcher with a map of patterns to values |
Method Summary | |
---|---|
S |
match(String line)
This method takes a String key and a map from Strings to values of any type. |
static boolean |
match(String pattern,
String str)
Lifted from AntPathMatcher in Spring Core. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PatternMatcher(Map<String,S> map)
PatternMatcher
with a map of patterns to values
map
- a map from String patterns to valuesMethod Detail |
---|
public static boolean match(String pattern, String str)
pattern
- pattern to match against. Must not be null
.str
- string which must be matched against the pattern. Must not be
null
.
true
if the string matches against the pattern, or
false
otherwise.public S match(String line)
This method takes a String key and a map from Strings to values of any type. During processing, the method will identify the most specific key in the map that matches the line. Once the correct is identified, its value is returned. Note that if the map contains the wildcard string "*" as a key, then it will serve as the "default" case, matching every line that does not match anything else.
If no matching prefix is found, a IllegalStateException
will be
thrown.
Null keys are not allowed in the map.
line
- An input string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |