Class ConfigCatalogRule
- java.lang.Object
-
- org.apache.commons.digester.Rule
-
- org.apache.commons.chain.config.ConfigCatalogRule
-
class ConfigCatalogRule extends org.apache.commons.digester.RuleDigester rule that will cause the top-most element on the Digester stack (if it is a
Catalogto be registered with theCatalogFactoryinstance for our application. If the attribute specified to our constructor has a value, that will be used as the name under which to register thisCatalog. Otherwise, this will become the defaultCatalogfor this application.- Version:
- $Revision: 480477 $ $Date: 2006-11-29 08:34:52 +0000 (Wed, 29 Nov 2006) $
- Author:
- Craig R. McClanahan
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringcatalogClassThe fully qualified class name of aCatalogclass to use for instantiating new instances.private java.lang.StringnameAttributeThe name of the attribute under which we can retrieve the name this catalog should be registered with (if any).
-
Constructor Summary
Constructors Constructor Description ConfigCatalogRule(java.lang.String nameAttribute, java.lang.String catalogClass)Construct a new instance of this rule that looks for an attribute with the specified name.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbegin(java.lang.String namespace, java.lang.String name, org.xml.sax.Attributes attributes)
-
-
-
Field Detail
-
catalogClass
private java.lang.String catalogClass
The fully qualified class name of a
Catalogclass to use for instantiating new instances.
-
nameAttribute
private java.lang.String nameAttribute
The name of the attribute under which we can retrieve the name this catalog should be registered with (if any).
-
-
Constructor Detail
-
ConfigCatalogRule
public ConfigCatalogRule(java.lang.String nameAttribute, java.lang.String catalogClass)Construct a new instance of this rule that looks for an attribute with the specified name.
- Parameters:
nameAttribute- Name of the attribute containing the name under which this command should be registeredcatalogClass- Name of the implementation class for newly createdCataloginstances
-
-
Method Detail
-
begin
public void begin(java.lang.String namespace, java.lang.String name, org.xml.sax.Attributes attributes) throws java.lang.ExceptionRetrieve or create a
Catalogwith the name specified by thenameAttributeattribute, or the defaultCatalogif there is no such attribute defined. Push it onto the top of the stack.- Overrides:
beginin 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
-
-