| java.lang.Object org.apache.commons.digester.plugins.Declaration
Declaration | public class Declaration (Code) | | Represents a Class that can be instantiated by a PluginCreateRule, plus
info on how to load custom digester rules for mapping xml into that
plugged-in class.
since: 1.6 |
Constructor Summary | |
public | Declaration(String pluginClassName) Constructor. | public | Declaration(Class pluginClass) Constructor. | public | 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 | |
public void | configure(Digester digester, String pattern) Attempt to load custom rules for the target class at the specified
pattern. | public String | getId() Return the id associated with this declaration. | public Class | getPluginClass() Return plugin class associated with this declaration. | public void | init(Digester digester, PluginManager pm) Must be called exactly once, and must be called before any call
to the configure method. | public void | setId(String id) The id that the user associated with a particular plugin declaration
in the input xml. | public void | setProperties(Properties p) Copy all (key,value) pairs in the param into the properties member of
this object.
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. |
Declaration | public Declaration(String pluginClassName)(Code) | | Constructor.
|
Declaration | public Declaration(Class pluginClass)(Code) | | Constructor.
|
Declaration | public Declaration(Class pluginClass, RuleLoader ruleLoader)(Code) | | Create an instance where a fully-initialised ruleLoader instance
is provided by the caller instead of having the PluginManager
"discover" an appropriate one.
|
configure | public void configure(Digester digester, String pattern) throws PluginException(Code) | | Attempt to load custom rules for the target class at the specified
pattern.
On return, any custom rules associated with the plugin class have
been loaded into the Rules object currently associated with the
specified digester object.
|
getId | public String getId()(Code) | | Return the id associated with this declaration. For plugins
declared "inline", null will be returned.
The id value. May be null. |
getPluginClass | public Class getPluginClass()(Code) | | Return plugin class associated with this declaration.
The pluginClass. |
setId | public void setId(String id)(Code) | | The id that the user associated with a particular plugin declaration
in the input xml. This id is later used in the input xml to refer
back to the original declaration.
For plugins declared "in-line", the id is null.
|
setProperties | public void setProperties(Properties p)(Code) | | Copy all (key,value) pairs in the param into the properties member of
this object.
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.
|
|
|