Class DigesterRuleParser.RulesPrefixAdapter

  • All Implemented Interfaces:
    Rules
    Enclosing class:
    DigesterRuleParser

    private class DigesterRuleParser.RulesPrefixAdapter
    extends java.lang.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 Summary

      Fields 
      Modifier and Type Field Description
      private Rules delegate  
      private java.lang.String prefix  
    • Constructor Summary

      Constructors 
      Constructor Description
      RulesPrefixAdapter​(java.lang.String patternPrefix, Rules rules)  
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void add​(java.lang.String pattern, Rule rule)
      Register a new Rule instance matching a pattern which is constructed by concatenating the pattern prefix with the given pattern.
      void clear()
      This method passes through to the underlying Rules object.
      Digester getDigester()
      This method passes through to the underlying Rules object.
      java.lang.String getNamespaceURI()
      This method passes through to the underlying Rules object.
      java.util.List match​(java.lang.String pattern)
      Deprecated.
      Call match(namespaceURI,pattern) instead.
      java.util.List match​(java.lang.String namespaceURI, java.lang.String pattern)
      This method passes through to the underlying Rules object.
      java.util.List rules()
      This method passes through to the underlying Rules object.
      void setDigester​(Digester digester)
      This method passes through to the underlying Rules object.
      void setNamespaceURI​(java.lang.String namespaceURI)
      This method passes through to the underlying Rules object.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • delegate

        private Rules delegate
      • prefix

        private java.lang.String prefix
    • Constructor Detail

      • RulesPrefixAdapter

        public RulesPrefixAdapter​(java.lang.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 Detail

      • add

        public void add​(java.lang.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 java.lang.String getNamespaceURI()
        This method passes through to the underlying Rules object.
        Specified by:
        getNamespaceURI in interface Rules
      • match

        public java.util.List match​(java.lang.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 java.util.List match​(java.lang.String namespaceURI,
                                    java.lang.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 java.util.List 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​(java.lang.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