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

public abstract class AbstractMatcherContainer extends AbstractHeaderMatcher
A class that implements IHeaderMatcher as a collection of other IHeaderMatchers.
  • Constructor Details

    • AbstractMatcherContainer

      public AbstractMatcherContainer(String id, Collection<? extends IHeaderMatcher> enclosed, String resource)
      Constructs the abstract matcher container. If the id is not set then a unique random identifier is created. The enclosed 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

      public AbstractMatcherContainer(Collection<? extends IHeaderMatcher> enclosed, String resource)
      Constructs the abstract matcher container with a unique random id. The enclosed 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

      public Collection<IHeaderMatcher> getEnclosed()
      Retrieves the collection of matchers that comprise the children of this matcher.
      Returns:
      the children of this matcher
    • getResource

      public String getResource()
      Get the resource that was provided in the constructor.
      Returns:
      the resource or null if none was provided in the constructor.