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
ConstructorsConstructorDescriptionOrMatcher(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 matchlineand returns the State after the match is attempted.voidreset()Resets this stateState.i.Methods inherited from class org.apache.rat.analysis.matchers.AbstractMatcherContainer
finalizeStateMethods 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:IHeaderMatcherAttempts to matchlineand 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:IHeaderMatcherGets the the current state of the matcher. All matchers should be inState.iat the start.- Returns:
- the current state of the matcher.
-
reset
public void reset()Description copied from interface:IHeaderMatcherResets this stateState.i. If text is being cached this method should clear that cache.- Specified by:
resetin interfaceIHeaderMatcher- Overrides:
resetin classAbstractMatcherContainer
-