Package org.apache.rat.analysis.matchers
Class AbstractMatcherContainer
java.lang.Object
org.apache.rat.analysis.matchers.AbstractHeaderMatcher
org.apache.rat.analysis.matchers.AbstractMatcherContainer
- All Implemented Interfaces:
IHeaderMatcher
- Direct Known Subclasses:
AndMatcher
,OrMatcher
A class that implements IHeaderMatcher as a collection of other
IHeaderMatchers.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.rat.analysis.IHeaderMatcher
IHeaderMatcher.Builder
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractMatcherContainer
(String id, Collection<? extends IHeaderMatcher> enclosed, String resource) Constructs the abstract matcher container.AbstractMatcherContainer
(Collection<? extends IHeaderMatcher> enclosed, String resource) Constructs the abstract matcher container with a unique random id. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the collection of matchers that comprise the children of this matcher.Get the resource that was provided in the constructor.void
reset()
Resets this state of this matcher to its initial state in preparation for use with another document scan.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, matches
-
Constructor Details
-
AbstractMatcherContainer
public AbstractMatcherContainer(String id, Collection<? extends IHeaderMatcher> enclosed, String resource) Constructs the abstract matcher container. If theid
is not set then a unique random identifier is created. Theenclosed
collection is preserved in a new collection that retains the order of of the original collection.- Parameters:
id
- The id for the matcher.enclosed
- the collection of enclosed matchers.resource
- the name of the resource if this container was read from a file or URL.
-
AbstractMatcherContainer
Constructs the abstract matcher container with a unique random id. Theenclosed
collection is preserved in a new collection that retains the order of of the original collection.- Parameters:
enclosed
- the collection of enclosed matchers.resource
- the name of the resource if this container was read from a file or URL.
-
-
Method Details
-
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. -
getEnclosed
Retrieves the collection of matchers that comprise the children of this matcher.- Returns:
- the children of this matcher
-
getResource
Get the resource that was provided in the constructor.- Returns:
- the resource or
null
if none was provided in the constructor.
-