org.apache.commons.digester.plugins
public class Declaration extends Object
Since: 1.6
Field Summary | |
---|---|
String | id See {@link #setId}. |
boolean | initialized See {@link #init}. |
Class | pluginClass The class of the object to be instantiated. |
String | pluginClassName The name of the class of the object to be instantiated. |
Properties | properties See {@link #setProperties}. |
RuleLoader | ruleLoader
Class which is responsible for dynamically loading this
plugin's rules on demand. |
Constructor Summary | |
---|---|
Declaration(String pluginClassName)
Constructor. | |
Declaration(Class pluginClass)
Constructor. | |
Declaration(Class pluginClass, RuleLoader ruleLoader)
Create an instance where a fully-initialised ruleLoader instance
is provided by the caller instead of having the PluginManager
"discover" an appropriate one. |
Method Summary | |
---|---|
void | configure(Digester digester, String pattern)
Attempt to load custom rules for the target class at the specified
pattern.
|
String | getId()
Return the id associated with this declaration. |
Class | getPluginClass()
Return plugin class associated with this declaration.
|
void | init(Digester digester, PluginManager pm)
Must be called exactly once, and must be called before any call
to the configure method. |
void | setId(String id)
The id that the user associated with a particular plugin declaration
in the input xml. |
void | setProperties(Properties p)
Copy all (key,value) pairs in the param into the properties member of
this object.
|
On return, any custom rules associated with the plugin class have been loaded into the Rules object currently associated with the specified digester object.
Returns: The id value. May be null.
Returns: The pluginClass.
For plugins declared "in-line", the id is null.
The declaration properties cannot be explicit member variables, because the set of useful properties a user can provide on a declaration depends on what RuleFinder classes are available - and extra RuleFinders can be added by the user. So here we keep a map of the settings, and let the RuleFinder objects look for whatever properties they consider significant.
The "id" and "class" properties are treated differently.