Class PluginDeclarationRule
java.lang.Object
org.apache.commons.digester3.Rule
org.apache.commons.digester3.plugins.PluginDeclarationRule
A Digester rule which allows the user to pre-declare a class which is to be referenced later at a plugin point by a
PluginCreateRule.
Normally, a PluginDeclarationRule is added to a Digester instance with the pattern "{root}/plugin" or "* /plugin" where {root} is the name of the root tag in the input document.
- Since:
- 1.6
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
begin
(String namespace, String name, Attributes attributes) Invoked upon reading a tag defining a plugin declaration.static void
declarePlugin
(Digester digester, Properties props) Helper method to declare a plugin inside the given Digester.Methods inherited from class org.apache.commons.digester3.Rule
body, end, finish, getDigester, getNamespaceURI, setDigester, setNamespaceURI
-
Constructor Details
-
PluginDeclarationRule
public PluginDeclarationRule()constructor
-
-
Method Details
-
begin
Invoked upon reading a tag defining a plugin declaration. The tag must have the following mandatory attributes:- id
- class
- Overrides:
begin
in classRule
- Parameters:
namespace
- The xml namespace in which the xml element which triggered this rule resides.name
- The name of the xml element which triggered this rule.attributes
- The set of attributes on the xml element which triggered this rule.- Throws:
Exception
- if any error occurs
-
declarePlugin
Helper method to declare a plugin inside the given Digester.- Parameters:
digester
- The Digester instance to declare pluginprops
- the properties where extracting plugin attributes- Throws:
PluginException
- if any error occurs while declaring the plugin
-