Package org.apache.rat.analysis.matchers
Class SimpleRegexMatcher
java.lang.Object
org.apache.rat.analysis.matchers.AbstractHeaderMatcher
org.apache.rat.analysis.matchers.AbstractSimpleMatcher
org.apache.rat.analysis.matchers.SimpleRegexMatcher
- All Implemented Interfaces:
IHeaderMatcher
A simple regular expression matching IHeaderMatcher
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.rat.analysis.IHeaderMatcher
IHeaderMatcher.Builder, IHeaderMatcher.State
-
Constructor Summary
ConstructorDescriptionSimpleRegexMatcher(String id, Pattern pattern)
Constructs a regex pattern matcher with a unique random id and the specified Regex pattern.SimpleRegexMatcher(Pattern pattern)
Constructs a regex pattern matcher with a unique random id and the specified Regex pattern. -
Method Summary
Methods inherited from class org.apache.rat.analysis.matchers.AbstractSimpleMatcher
currentState, finalizeState, matches, reset
Methods inherited from class org.apache.rat.analysis.matchers.AbstractHeaderMatcher
getId, toString
-
Constructor Details
-
SimpleRegexMatcher
Constructs a regex pattern matcher with a unique random id and the specified Regex pattern.- Parameters:
pattern
- the pattern to match. Pattern will only match a single line from the input stream.
-
SimpleRegexMatcher
Constructs a regex pattern matcher with a unique random id and the specified Regex pattern.- Parameters:
id
- the id for this matcherpattern
- the pattern to match. Pattern will only match a single line from the input stream.
-
-
Method Details
-
doMatch
Description copied from class:AbstractSimpleMatcher
Performs the actual match test.- Specified by:
doMatch
in classAbstractSimpleMatcher
- Parameters:
line
- the line to check.- Returns:
true
if the line matches,false
otherwise.
-