Package org.apache.rat.analysis.matchers
Class FullTextMatcher
java.lang.Object
org.apache.rat.analysis.matchers.AbstractHeaderMatcher
org.apache.rat.analysis.matchers.AbstractSimpleMatcher
org.apache.rat.analysis.matchers.FullTextMatcher
- All Implemented Interfaces:
IHeaderMatcher
Accumulates all letters and numbers contained inside the header and compares
it to the full text of a given license (after reducing it to letters and
numbers as well).
The text comparison is case insensitive but assumes only characters in the US-ASCII charset are being matched.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.rat.analysis.IHeaderMatcher
IHeaderMatcher.Builder, IHeaderMatcher.State -
Constructor Summary
ConstructorsConstructorDescriptionFullTextMatcher(String fullText)Constructs the full text matcher with a unique random id and the specified text to match.FullTextMatcher(String id, String fullText)Constructs the full text matcher for the specified text. -
Method Summary
Methods inherited from class org.apache.rat.analysis.matchers.AbstractSimpleMatcher
currentState, finalizeState, matchesMethods inherited from class org.apache.rat.analysis.matchers.AbstractHeaderMatcher
getId, toString
-
Constructor Details
-
FullTextMatcher
Constructs the full text matcher with a unique random id and the specified text to match.- Parameters:
fullText- the text to match
-
FullTextMatcher
Constructs the full text matcher for the specified text.- Parameters:
id- the id for the matcherfullText- the text to match
-
-
Method Details
-
prune
Removes everything except letter or digit from text.- Parameters:
text- The text to remove extra chars from.- Returns:
- the pruned text.
-
doMatch
Description copied from class:AbstractSimpleMatcherPerforms the actual match test.- Specified by:
doMatchin classAbstractSimpleMatcher- Parameters:
line- the line to check.- Returns:
trueif the line matches,falseotherwise.
-
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 classAbstractSimpleMatcher
-