Package org.apache.rat.analysis.matchers
Class SimpleRegexMatcher
java.lang.Object
org.apache.rat.analysis.matchers.AbstractHeaderMatcher
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
-
Constructor Summary
ConstructorsConstructorDescriptionSimpleRegexMatcher
(String id, Pattern pattern) Constructs a regex pattern matcher with a unique random id and the specified Regex pattern. -
Method Summary
Modifier and TypeMethodDescriptionGets the expression of the underlying matching pattern.boolean
Attempts to match text in the IHeaders instance.Methods inherited from class org.apache.rat.analysis.matchers.AbstractHeaderMatcher
getId, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.rat.analysis.IHeaderMatcher
getDescription, reset
-
Constructor Details
-
SimpleRegexMatcher
Constructs a regex pattern matcher with a unique random id and the specified Regex pattern.- Parameters:
id
- the id for this matcher, may be nullpattern
- the pattern to match. Pattern will only match a single line from the input stream.
-
-
Method Details
-
getExpression
Gets the expression of the underlying matching pattern.- Returns:
- the underlying pattern's construction expression.
-
matches
Description copied from interface:IHeaderMatcher
Attempts to match text in the IHeaders instance.- Parameters:
headers
- the representations of the headers to check- Returns:
true
if the matcher matches the text,false
otherwise.
-