Class DigesterRuleParser.RulesPrefixAdapter

java.lang.Object
org.apache.commons.digester.xmlrules.DigesterRuleParser.RulesPrefixAdapter
All Implemented Interfaces:
Rules
Enclosing class:
DigesterRuleParser

private class DigesterRuleParser.RulesPrefixAdapter extends Object implements Rules
Wraps a Rules object. Delegates all the Rules interface methods to the underlying Rules object. Overrides the add method to prepend a prefix to the pattern string.
  • Field Details

    • delegate

      private Rules delegate
    • prefix

      private String prefix
  • Constructor Details

    • RulesPrefixAdapter

      public RulesPrefixAdapter(String patternPrefix, Rules rules)
      Parameters:
      patternPrefix - the pattern string to prepend to the pattern passed to the add method.
      rules - The wrapped Rules object. All of this class's methods pass through to this object.
  • Method Details

    • add

      public void add(String pattern, Rule rule)
      Register a new Rule instance matching a pattern which is constructed by concatenating the pattern prefix with the given pattern.
      Specified by:
      add in interface Rules
      Parameters:
      pattern - Nesting pattern to be matched for this Rule
      rule - Rule instance to be registered
    • clear

      public void clear()
      This method passes through to the underlying Rules object.
      Specified by:
      clear in interface Rules
    • getDigester

      public Digester getDigester()
      This method passes through to the underlying Rules object.
      Specified by:
      getDigester in interface Rules
    • getNamespaceURI

      public String getNamespaceURI()
      This method passes through to the underlying Rules object.
      Specified by:
      getNamespaceURI in interface Rules
    • match

      @Deprecated public List<Rule> match(String pattern)
      Deprecated.
      Call match(namespaceURI,pattern) instead.
      Description copied from interface: Rules
      Return a List of all registered Rule instances that match the specified nesting pattern, or a zero-length List if there are no matches. If more than one Rule instance matches, they must be returned in the order originally registered through the add() method.
      Specified by:
      match in interface Rules
      Parameters:
      pattern - Nesting pattern to be matched
    • match

      public List<Rule> match(String namespaceURI, String pattern)
      This method passes through to the underlying Rules object.
      Specified by:
      match in interface Rules
      Parameters:
      namespaceURI - Namespace URI for which to select matching rules, or null to match regardless of namespace URI
      pattern - Nesting pattern to be matched
    • rules

      public List<Rule> rules()
      This method passes through to the underlying Rules object.
      Specified by:
      rules in interface Rules
    • setDigester

      public void setDigester(Digester digester)
      This method passes through to the underlying Rules object.
      Specified by:
      setDigester in interface Rules
      Parameters:
      digester - The newly associated Digester instance
    • setNamespaceURI

      public void setNamespaceURI(String namespaceURI)
      This method passes through to the underlying Rules object.
      Specified by:
      setNamespaceURI in interface Rules
      Parameters:
      namespaceURI - Namespace URI that must match on all subsequently added rules, or null for matching regardless of the current namespace URI