Package org.apache.rat.analysis.matchers
Class OrMatcher
java.lang.Object
org.apache.rat.analysis.matchers.AbstractHeaderMatcher
org.apache.rat.analysis.matchers.AbstractMatcherContainer
org.apache.rat.analysis.matchers.OrMatcher
- All Implemented Interfaces:
IHeaderMatcher
A matcher that performs a logical
OR
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
ConstructorDescriptionOrMatcher(String id, Collection<? extends IHeaderMatcher> enclosed)
Constructs the matcher with the specified id from the enclosed matchers.OrMatcher(Collection<? extends IHeaderMatcher> enclosed)
Constructs the matcher from the enclosed matchers. -
Method Summary
Modifier and TypeMethodDescriptionGets the the current state of the matcher.Attempts to matchline
and returns the State after the match is attempted.void
reset()
Resets this stateState.i
.Methods inherited from class org.apache.rat.analysis.matchers.AbstractMatcherContainer
finalizeState
Methods inherited from class org.apache.rat.analysis.matchers.AbstractHeaderMatcher
getId, toString
-
Constructor Details
-
OrMatcher
Constructs the matcher from the enclosed matchers.- Parameters:
enclosed
- the enclosed matchers.
-
OrMatcher
Constructs the matcher with the specified id from the enclosed matchers.- Parameters:
id
- the id to use.enclosed
- the enclosed matchers.
-
-
Method Details
-
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.
-
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.
-
reset
public void reset()Description copied from interface:IHeaderMatcher
Resets this stateState.i
. If text is being cached this method should clear that cache.- Specified by:
reset
in interfaceIHeaderMatcher
- Overrides:
reset
in classAbstractMatcherContainer
-