Package org.apache.ivy.plugins.matcher
Class AbstractPatternMatcher
- java.lang.Object
-
- org.apache.ivy.plugins.matcher.AbstractPatternMatcher
-
- All Implemented Interfaces:
PatternMatcher
- Direct Known Subclasses:
ExactOrRegexpPatternMatcher
,ExactPatternMatcher
,GlobPatternMatcher
,RegexpPatternMatcher
public abstract class AbstractPatternMatcher extends java.lang.Object implements PatternMatcher
An abstract implementation of the pattern matcher providing base template methods
-
-
Field Summary
-
Fields inherited from interface org.apache.ivy.plugins.matcher.PatternMatcher
ANY_EXPRESSION, EXACT, EXACT_OR_REGEXP, GLOB, REGEXP
-
-
Constructor Summary
Constructors Constructor Description AbstractPatternMatcher(java.lang.String name)
Create a new instance of a pattern matcher
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Matcher
getMatcher(java.lang.String expression)
Return the matcher for the given expression.java.lang.String
getName()
return the name of this pattern matcherprotected abstract Matcher
newMatcher(java.lang.String expression)
Returns an instance of the implementation specific matcher.java.lang.String
toString()
-
-
-
Method Detail
-
getMatcher
public Matcher getMatcher(java.lang.String expression)
Description copied from interface:PatternMatcher
Return the matcher for the given expression.- Specified by:
getMatcher
in interfacePatternMatcher
- Parameters:
expression
- the expression to be matched. Cannot be null ?- Returns:
- the matcher instance for the given expression. Never null.
-
getName
public java.lang.String getName()
Description copied from interface:PatternMatcher
return the name of this pattern matcher- Specified by:
getName
in interfacePatternMatcher
- Returns:
- the name of this pattern matcher. Never null.
- See Also:
PatternMatcher.EXACT
,PatternMatcher.REGEXP
,PatternMatcher.GLOB
,PatternMatcher.EXACT_OR_REGEXP
-
newMatcher
protected abstract Matcher newMatcher(java.lang.String expression)
Returns an instance of the implementation specific matcher.- Parameters:
expression
- the string to be matched.- Returns:
- the instance of the related matcher. Never null.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-