Class PluginCreateRuleBuilder

java.lang.Object
org.apache.commons.digester3.binder.PluginCreateRuleBuilder
All Implemented Interfaces:
RuleProvider<PluginCreateRule>

public final class PluginCreateRuleBuilder extends Object
Builder chained when invoking LinkedRuleBuilder.createPlugin().
Since:
3.0
  • Method Details

    • ofType

      public <T> PluginCreateRuleBuilder ofType(Class<T> type)
      Set the class which any specified plugin must be descended from.
      Type Parameters:
      T - Any Java type
      Parameters:
      type - the class which any specified plugin must be descended from
      Returns:
      this builder instance
    • usingDefaultPluginClass

      Set the class which will be used if the user doesn't specify any plugin-class or plugin-id.
      Type Parameters:
      T - Any Java type
      Parameters:
      type - the class which will be used if the user doesn't specify any plugin-class or plugin-id.
      Returns:
      this builder instance
    • usingRuleLoader

      public <RL extends RuleLoader> PluginCreateRuleBuilder usingRuleLoader(RL ruleLoader)
      Set RuleLoader instance which knows how to load the custom rules associated with the default plugin.
      Type Parameters:
      RL - Any RuleLoader extension.
      Parameters:
      ruleLoader - the RuleLoader instance which knows how to load the custom rules associated with the default plugin.
      Returns:
      this builder instance
    • setPluginClassAttribute

      Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which class should be instantiated.
      Parameters:
      attrName - the xml attribute which the input xml uses to indicate to a PluginCreateRule which class should be instantiated.
      Returns:
      this builder instance
    • setPluginClassAttribute

      Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which class should be instantiated.
      Parameters:
      namespaceUri - The attribute NameSpace
      attrName - The attribute name
      Returns:
      this builder instance
    • setPluginIdAttribute

      Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which plugin declaration is being referenced.
      Parameters:
      attrName - The attribute name
      Returns:
      this builder instance
    • setPluginIdAttribute

      public PluginCreateRuleBuilder setPluginIdAttribute(String namespaceUri, String attrName)
      Sets the xml attribute which the input xml uses to indicate to a PluginCreateRule which plugin declaration is being referenced.
      Parameters:
      namespaceUri - The attribute NameSpace
      attrName - The attribute name
      Returns:
      this builder instance
    • createRule

      Provides an instance of Rule. Must never return null.
      Returns:
      an instance of Rule.
      See Also:
    • then

      public final LinkedRuleBuilder then()
      Come back to the main LinkedRuleBuilder.
      Returns:
      the main LinkedRuleBuilder
    • getNamespaceURI

      public final String getNamespaceURI()
      Returns the namespace URI for which this Rule is relevant, if any.
      Returns:
      The namespace URI for which this Rule is relevant, if any
    • get

      public final PluginCreateRule get()
      Provides an instance of Rule. Must never return null.
      Specified by:
      get in interface RuleProvider<R extends Rule>
      Returns:
      an instance of Rule.
    • reportError

      protected final void reportError(String methodChain, String message)
    • getPattern

      public final String getPattern()
      Returns the rule pattern associated to this builder.
      Returns:
      The rule pattern associated to this builder