Package org.apache.rat.analysis.matchers
Class NotMatcher
java.lang.Object
org.apache.rat.analysis.matchers.AbstractHeaderMatcher
org.apache.rat.analysis.matchers.NotMatcher
- All Implemented Interfaces:
IHeaderMatcher
An IHeaderMatcher that reverses the result of an enclosed matcher.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.rat.analysis.IHeaderMatcher
IHeaderMatcher.Builder, IHeaderMatcher.State
-
Constructor Summary
ConstructorDescriptionNotMatcher(String id, IHeaderMatcher enclosed)
Create the matcher with the enclosed matcher and id.NotMatcher(IHeaderMatcher enclosed)
Create the matcher with the enclosed matcher. -
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.void
reset()
Resets this stateState.i
.Methods inherited from class org.apache.rat.analysis.matchers.AbstractHeaderMatcher
getId, toString
-
Constructor Details
-
NotMatcher
Create the matcher with the enclosed matcher.- Parameters:
enclosed
- the enclosed matcher
-
NotMatcher
Create the matcher with the enclosed matcher and id.- Parameters:
id
- the id for this matcher.enclosed
- the enclosed matcher
-
-
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.
-
reset
public void reset()Description copied from interface:IHeaderMatcher
Resets this stateState.i
. If text is being cached this method should clear that cache. -
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. -
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.
-