Class ConfigDefineRule
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
and Command
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
FieldsModifier and TypeFieldDescriptionprivate String
The name of the attribute under which we can retrieve the fully qualified class name of the implementation class for this new element.private String
The name of the attribute under which we can retrieve the name this element for which rules should be created.Fields inherited from class org.apache.commons.digester.Rule
digester, namespaceURI
-
Constructor Summary
ConstructorsConstructorDescriptionConfigDefineRule
(String nameAttribute, String classAttribute) Construct a new instance of this rule that will in turn dynamically register appropriate rules for a new alias element. -
Method Summary
Modifier and TypeMethodDescriptionvoid
begin
(String namespace, String name, Attributes attributes) Register new rules for the specified name and class.Methods inherited from class org.apache.commons.digester.Rule
begin, body, body, end, end, finish, getDigester, getNamespaceURI, setDigester, setNamespaceURI
-
Field Details
-
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
The name of the attribute under which we can retrieve the name this element for which rules should be created.
-
-
Constructor Details
-
ConfigDefineRule
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 Details
-
begin
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:
Exception
-