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
getSimpleText
Methods inherited from class org.apache.rat.analysis.matchers.AbstractHeaderMatcher
getId, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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:IHeaderMatcher
Attempts to match text in the IHeaders instance.- Specified by:
matches
in interfaceIHeaderMatcher
- Overrides:
matches
in classSimpleTextMatcher
- Parameters:
headers
- the representations of the headers to check- Returns:
true
if the matcher matches the text,false
otherwise.
-