Class ConfigDefineRule
- java.lang.Object
-
- org.apache.commons.digester.Rule
-
- org.apache.commons.chain.config.ConfigDefineRule
-
class ConfigDefineRule extends org.apache.commons.digester.Rule
Digester rule that will dynamically register a new set of rules for a specified element name and default implementation class. This allows "alias" elements to be created for
Chain
andCommand
implementation classes that are commonly used. Besides factoring out the class names to make changes easier, this also makes configuration files much easier to read and write.- Version:
- $Revision: 480477 $ $Date: 2006-11-29 08:34:52 +0000 (Wed, 29 Nov 2006) $
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
classAttribute
The name of the attribute under which we can retrieve the fully qualified class name of the implementation class for this new element.private java.lang.String
nameAttribute
The name of the attribute under which we can retrieve the name this element for which rules should be created.
-
Constructor Summary
Constructors Constructor Description ConfigDefineRule(java.lang.String nameAttribute, java.lang.String classAttribute)
Construct a new instance of this rule that will in turn dynamically register appropriate rules for a new alias element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
begin(java.lang.String namespace, java.lang.String name, org.xml.sax.Attributes attributes)
Register new rules for the specified name and class.
-
-
-
Field Detail
-
classAttribute
private java.lang.String classAttribute
The name of the attribute under which we can retrieve the fully qualified class name of the implementation class for this new element.
-
nameAttribute
private java.lang.String nameAttribute
The name of the attribute under which we can retrieve the name this element for which rules should be created.
-
-
Constructor Detail
-
ConfigDefineRule
public ConfigDefineRule(java.lang.String nameAttribute, java.lang.String classAttribute)
Construct a new instance of this rule that will in turn dynamically register appropriate rules for a new alias element.
- Parameters:
nameAttribute
- Name of the attribute containing the name of the new element for which rules should generatedclassAttribute
- Name of the attribute containing the implementation class for the new chain or command
-
-
Method Detail
-
begin
public void begin(java.lang.String namespace, java.lang.String name, org.xml.sax.Attributes attributes) throws java.lang.Exception
Register new rules for the specified name and class.
- Overrides:
begin
in classorg.apache.commons.digester.Rule
- Parameters:
namespace
- the namespace URI of the matching element, or an empty string if the parser is not namespace aware or the element has no namespacename
- the local name if the parser is namespace aware, or just the element name otherwiseattributes
- The attribute list of this element- Throws:
java.lang.Exception
-
-