Package org.apache.struts2.util
Interface PatternMatcher<E>
- All Known Implementing Classes:
NamedVariablePatternMatcher
,RegexPatternMatcher
,WildcardHelper
public interface PatternMatcher<E>
Compiles and matches a pattern against a value
- Since:
- 2.1
-
Method Summary
Modifier and TypeMethodDescriptioncompilePattern
(String data) Translate the givenString
into an object representing the pattern matchable by this class.boolean
Determines if the pattern is a simple literal string or contains wildcards that will need to be processedboolean
Match a pattern against a string
-
Method Details
-
isLiteral
Determines if the pattern is a simple literal string or contains wildcards that will need to be processed- Parameters:
pattern
- The string pattern- Returns:
- True if the pattern doesn't contain processing elements, false otherwise
-
compilePattern
Translate the given
String
into an object representing the pattern matchable by this class.- Parameters:
data
- The string to translate.- Returns:
- The encoded string
- Throws:
NullPointerException
- If data is null.
-
match
Match a pattern against a string- Parameters:
map
- The map to store matched valuesdata
- The string to matchexpr
- The compiled wildcard expression- Returns:
- True if a match
- Throws:
NullPointerException
- If any parameters are null
-