Package org.apache.rat.analysis.matchers
Class FullTextMatcher
java.lang.Object
org.apache.rat.analysis.matchers.AbstractHeaderMatcher
org.apache.rat.analysis.matchers.SimpleTextMatcher
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 -
Constructor Summary
ConstructorsConstructorDescriptionFullTextMatcher(String simpleText)Constructs the full text matcher with a unique random id and the specified text to match.FullTextMatcher(String id, String simpleText)Constructs the full text matcher for the specified text. -
Method Summary
Methods inherited from class org.apache.rat.analysis.matchers.SimpleTextMatcher
getSimpleTextMethods inherited from class org.apache.rat.analysis.matchers.AbstractHeaderMatcher
getId, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.rat.analysis.IHeaderMatcher
getDescription, reset
-
Constructor Details
-
FullTextMatcher
Constructs the full text matcher with a unique random id and the specified text to match.- Parameters:
simpleText- the text to match
-
FullTextMatcher
Constructs the full text matcher for the specified text.- Parameters:
id- the id for the matchersimpleText- 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.
-
matches
Description copied from interface:IHeaderMatcherAttempts to match text in the IHeaders instance.- Specified by:
matchesin interfaceIHeaderMatcher- Overrides:
matchesin classSimpleTextMatcher- Parameters:
headers- the representations of the headers to check- Returns:
trueif the matcher matches the text,falseotherwise.
-