Class PluginCreateRuleBuilder

    • Field Detail

      • pluginClassAttributes

        private final java.util.Map<java.lang.String,​java.lang.String> pluginClassAttributes
      • pluginIdAttributes

        private final java.util.Map<java.lang.String,​java.lang.String> pluginIdAttributes
      • baseClass

        private java.lang.Class<?> baseClass
      • dfltPluginClass

        private java.lang.Class<?> dfltPluginClass
      • dfltPluginRuleLoader

        private RuleLoader dfltPluginRuleLoader
    • Constructor Detail

      • PluginCreateRuleBuilder

        PluginCreateRuleBuilder​(java.lang.String keyPattern,
                                java.lang.String namespaceURI,
                                RulesBinder mainBinder,
                                LinkedRuleBuilder mainBuilder)
    • Method Detail

      • ofType

        public <T> PluginCreateRuleBuilder ofType​(java.lang.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

        public <T> PluginCreateRuleBuilder usingDefaultPluginClass​(java.lang.Class<T> type)
        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 RuleLoaderPluginCreateRuleBuilder 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

        public PluginCreateRuleBuilder setPluginClassAttribute​(java.lang.String attrName)
        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

        public PluginCreateRuleBuilder setPluginClassAttribute​(java.lang.String namespaceUri,
                                                               java.lang.String attrName)
        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

        public PluginCreateRuleBuilder setPluginIdAttribute​(java.lang.String attrName)
        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​(java.lang.String namespaceUri,
                                                            java.lang.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
      • addToMap

        private PluginCreateRuleBuilder addToMap​(java.util.Map<java.lang.String,​java.lang.String> map,
                                                 java.lang.String namespaceUri,
                                                 java.lang.String attrName)
        Private internal method to set values to a Map instance and return the current builder.
        Parameters:
        map - The target Map
        namespaceUri - The attribute NameSpace
        attrName - The attribute name
        Returns:
        this builder instance