Class MatcherRefBuilder.IHeaderMatcherProxy

java.lang.Object
org.apache.rat.configuration.builders.MatcherRefBuilder.IHeaderMatcherProxy
All Implemented Interfaces:
IHeaderMatcher
Enclosing class:
MatcherRefBuilder

public static class MatcherRefBuilder.IHeaderMatcherProxy extends Object implements IHeaderMatcher
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.
  • Constructor Details

    • IHeaderMatcherProxy

      public IHeaderMatcherProxy(String proxyId, Map<String,IHeaderMatcher> matchers)
      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

      public String getId()
      Description copied from interface: IHeaderMatcher
      Get the identifier for this matcher.

      All matchers must have unique identifiers

      Specified by:
      getId in interface IHeaderMatcher
      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 interface IHeaderMatcher
    • matches

      public boolean matches(IHeaders header)
      Description copied from interface: IHeaderMatcher
      Attempts to match text in the IHeaders instance.
      Specified by:
      matches in interface IHeaderMatcher
      Parameters:
      header - the representations of the headers to check
      Returns:
      true if the matcher matches the text, false otherwise.
    • getRefId

      public String getRefId()
      Gets the matcher ID that this proxy references.
      Returns:
      The matcher ID that this proxy references.