Package org.apache.rat.analysis.matchers
Class AndMatcher
java.lang.Object
org.apache.rat.analysis.matchers.AbstractHeaderMatcher
org.apache.rat.analysis.matchers.AbstractMatcherContainer
org.apache.rat.analysis.matchers.AndMatcher
- All Implemented Interfaces:
IHeaderMatcher
A matcher that performs a logical
AND
across all the contained matchers.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.rat.analysis.IHeaderMatcher
IHeaderMatcher.Builder, IHeaderMatcher.State
-
Field Summary
Fields inherited from class org.apache.rat.analysis.matchers.AbstractMatcherContainer
enclosed
-
Constructor Summary
ConstructorDescriptionAndMatcher(String id, Collection<? extends IHeaderMatcher> enclosed)
Constructs the AndMatcher with the specified id and enclosed collection.AndMatcher(Collection<? extends IHeaderMatcher> enclosed)
Constructs the AndMatcher with the a unique random id and the enclosed collection. -
Method Summary
Modifier and TypeMethodDescriptionGets the the current state of the matcher.Gets the final state for this matcher.Attempts to matchline
and returns the State after the match is attempted.Methods inherited from class org.apache.rat.analysis.matchers.AbstractMatcherContainer
reset
Methods inherited from class org.apache.rat.analysis.matchers.AbstractHeaderMatcher
getId, toString
-
Constructor Details
-
AndMatcher
Constructs the AndMatcher with the specified id and enclosed collection.- Parameters:
id
- the to use. If null or an empty string a unique random id will be created.enclosed
- the enclosed collection.
-
AndMatcher
Constructs the AndMatcher with the a unique random id and the enclosed collection.- Parameters:
enclosed
- the enclosed collection.
-
-
Method Details
-
currentState
Description copied from interface:IHeaderMatcher
Gets the the current state of the matcher. All matchers should be inState.i
at the start.- Returns:
- the current state of the matcher.
-
matches
Description copied from interface:IHeaderMatcher
Attempts to matchline
and returns the State after the match is attempted.- Parameters:
line
- next line of text, not null- Returns:
- the new state after the matching was attempted.
-
finalizeState
Description copied from interface:IHeaderMatcher
Gets the final state for this matcher. This is called after the EOF on the input. At this point there should be no matchers in anState.i
state.- Specified by:
finalizeState
in interfaceIHeaderMatcher
- Overrides:
finalizeState
in classAbstractMatcherContainer
-