Class FromBinderRuleSet

  • All Implemented Interfaces:
    RuleSet

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

      • FromBinderRuleSet

        FromBinderRuleSet()
    • Method Detail

      • 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​(java.lang.String keyPattern,
                                                                                                   java.lang.String namespaceURI,
                                                                                                   java.lang.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 java.lang.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