Class MatcherRefBuilder

java.lang.Object
org.apache.rat.configuration.builders.AbstractBuilder
org.apache.rat.configuration.builders.MatcherRefBuilder
All Implemented Interfaces:
IHeaderMatcher.Builder

public class MatcherRefBuilder extends AbstractBuilder
A reference matching Matcher builder.

This class stores a matcher id as a reference to the matcher. It also has a map of matcher ids to the matcher instances. When build() is called the matcher reference is looked up in the map. If it is found then its value is returned from the build() call. If the reference is not located then a IHeaderMatcherProxy is returned. the IHeaderMatcherProxy is resolved in a later configuration construction phase.

  • Constructor Details

    • MatcherRefBuilder

      public MatcherRefBuilder()
  • Method Details

    • setRefId

      public MatcherRefBuilder setRefId(String refId)
      Constructs the MatcherReferenceBuilder using the provided reference id.
      Parameters:
      refId - the reverence to the matcher id.
      Returns:
      this builder for chaining.
    • setMatcherMap

      public MatcherRefBuilder setMatcherMap(Map<String,IHeaderMatcher> matchers)
      Set the Map of matcher ids to matcher instances.
      Parameters:
      matchers - the Map of ids to instances.
      Returns:
      this builder for chaining.
    • build

      public IHeaderMatcher build()
      Description copied from interface: IHeaderMatcher.Builder
      Build the IHeaderMatcher.

      Implementations of this interface should return a specific child class of IHeaderMatcher.

      Returns:
      a new IHeaderMatcher.
    • toString

      public String toString()
      Overrides:
      toString in class AbstractBuilder