Class StringTemplateMatcher
java.lang.Object
jodd.util.StringTemplateMatcher
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classclass -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringprivate BiFunction<Integer, String, Boolean> private static final StringTemplateMatcher.Match[]private final Stringprivate Stringprivate final BiFunction<Integer, String, Boolean> private Stringprivate Stringprivate final BiFunction<Integer, String, Boolean> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncompile()Compiles the given pattern so it can be used for matching.booleanReturnstrueif macros are detected in the pattern.Returns all the matches for given input.booleanReturnstrueif the input matches the pattern.static StringTemplateMatchersetMacroPrefix(String prefix) setMacroSplit(String split) setMacroSuffix(String suffix) Uses regex matching patterns.Uses wildcard matching patterns.
-
Field Details
-
NO_MATCH
-
DEFAULT_MACRO_PREFIX
- See Also:
-
DEFAULT_MACRO_SPLIT
- See Also:
-
DEFAULT_MACRO_END
- See Also:
-
prefix
-
split
-
suffix
-
pattern
-
REGEX
-
WILDCARD
-
matchValue
-
compiled
-
-
Constructor Details
-
StringTemplateMatcher
-
-
Method Details
-
of
-
setMacroPrefix
-
setMacroSuffix
-
setMacroSplit
-
useWildcardMatch
-
useRegexMatch
Uses regex matching patterns. -
compile
Compiles the given pattern so it can be used for matching. It is invoked bymatch(String)andmatches(String)methods, so need to do it manually. You can call it any number of times, the pattern is compiled only once. -
hasMacros
public boolean hasMacros()Returnstrueif macros are detected in the pattern. -
matches
Returnstrueif the input matches the pattern. -
match
Returns all the matches for given input. If no matches found, an empty array is returned.
-