Class MatcherRefBuilder.IHeaderMatcherProxy
java.lang.Object
org.apache.rat.configuration.builders.MatcherRefBuilder.IHeaderMatcherProxy
- All Implemented Interfaces:
IHeaderMatcher
- Enclosing class:
MatcherRefBuilder
A class that is a proxy to the actual matcher. It retrieves the actual
matcher from the map of matcher ids to matcher instances on the first use of
the matcher. This allows earlier read matchers to reference later constructed
matchers as long as all the matchers are constructed before the earlier one
is used.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.rat.analysis.IHeaderMatcher
IHeaderMatcher.Builder
-
Constructor Summary
ConstructorsConstructorDescriptionIHeaderMatcherProxy
(String proxyId, Map<String, IHeaderMatcher> matchers) Constructor. -
Method Summary
Modifier and TypeMethodDescriptiongetId()
Get the identifier for this matcher.getRefId()
Gets the matcher ID that this proxy references.boolean
Attempts to match text in the IHeaders instance.void
reset()
Resets this state of this matcher to its initial state in preparation for use with another document scan.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.rat.analysis.IHeaderMatcher
getDescription
-
Constructor Details
-
IHeaderMatcherProxy
Constructor. The matchers map should be a reference to an object that will be updated by later processing of matcher definitions.- Parameters:
proxyId
- the id of the matcher to find.matchers
- a mapping of matchers that have been found.
-
-
Method Details
-
getId
Description copied from interface:IHeaderMatcher
Get the identifier for this matcher.All matchers must have unique identifiers
- Specified by:
getId
in interfaceIHeaderMatcher
- Returns:
- the identifier for this matcher.
-
reset
public void reset()Description copied from interface:IHeaderMatcher
Resets this state of this matcher to its initial state in preparation for use with another document scan. In most cases this method does not need to do anything.- Specified by:
reset
in interfaceIHeaderMatcher
-
matches
Description copied from interface:IHeaderMatcher
Attempts to match text in the IHeaders instance.- Specified by:
matches
in interfaceIHeaderMatcher
- Parameters:
header
- the representations of the headers to check- Returns:
true
if the matcher matches the text,false
otherwise.
-
getRefId
Gets the matcher ID that this proxy references.- Returns:
- The matcher ID that this proxy references.
-