Class FromBinderRuleSet

java.lang.Object
org.apache.commons.digester3.binder.FromBinderRuleSet
All Implemented Interfaces:
RuleSet

final class FromBinderRuleSet extends Object implements RuleSet
RuleSet implementation that allows register RuleProvider instances and add rules to the Digester.
Since:
3.0
  • Field Details

  • Constructor Details

    • FromBinderRuleSet

      FromBinderRuleSet()
  • Method Details

    • registerProvider

      public <R extends Rule, RB extends AbstractBackToLinkedRuleBuilder<R>> void registerProvider(RB ruleBuilder)
      Register the given rule builder and returns it.
      Type Parameters:
      R - The Digester rule type
      RB - The Digester rule builder type
      Parameters:
      ruleBuilder - The input rule builder instance.
    • getProvider

      public <R extends Rule, RB extends AbstractBackToLinkedRuleBuilder<R>> RB getProvider(String keyPattern, String namespaceURI, Class<RB> type)
      Returns the first instance of RuleProvider assignable to the input type. This method is useful for rules that requires be unique in the pattern, like SetPropertiesRule and SetNestedPropertiesRule.
      Type Parameters:
      R - The Digester rule type
      RB - The Digester rule builder type
      Parameters:
      keyPattern - the rule pattern
      namespaceURI - the namespace URI (can be null)
      type - the rule builder type the client is looking for
      Returns:
      the rule builder of input type, if any
    • clear

      public void clear()
      Clean the provider index.
    • addRuleInstances

      public void addRuleInstances(Digester digester)
      Add the set of Rule instances defined in this RuleSet to the specified Digester instance, associating them with our namespace URI (if any). This method should only be called by a Digester instance.
      Specified by:
      addRuleInstances in interface RuleSet
      Parameters:
      digester - Digester instance to which the new Rule instances should be added.
    • getNamespaceURI

      public String getNamespaceURI()
      Return the namespace URI that will be applied to all Rule instances created from this RuleSet.
      Specified by:
      getNamespaceURI in interface RuleSet
      Returns:
      the namespace URI that will be applied to all Rule instances created from this RuleSet