java.lang.ObjectProvides data and services which should exist only once per digester.org.apache.commons.digester.plugins.PluginContext
This class holds a number of useful items which should be shared by all plugin objects. Such data cannot be stored on the PluginRules or PluginManager classes, as there can be multiple instances of these at various times during a parse.
The name "Context" refers to the similarity between this class and a ServletContext class in a servlet engine. A ServletContext object provides access to the container's services such as obtaining global configuration parameters for the container, or getting access to logging services. For plugins, a Digester instance can be regarded as "the container".
1.6 - | Field Summary | ||
|---|---|---|
| public final String | DFLT_PLUGIN_CLASS_ATTR_NS | |
| public final String | DFLT_PLUGIN_CLASS_ATTR | |
| public final String | DFLT_PLUGIN_ID_ATTR_NS | |
| public final String | DFLT_PLUGIN_ID_ATTR | |
| Constructor: |
|---|
|
| Method from org.apache.commons.digester.plugins.PluginContext Summary: |
|---|
| getPluginClassAttr, getPluginClassAttrNs, getPluginIdAttr, getPluginIdAttrNs, getRuleFinders, setPluginClassAttribute, setPluginIdAttribute, setRuleFinders |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.apache.commons.digester.plugins.PluginContext Detail: |
|---|
The return value is never null. |
May be null (in fact, normally will be). |
The return value is never null. |
May be null (in fact, normally will be). |
It is explicitly permitted for the caller to modify this list by inserting or removing RuleFinder objects. |
Example: setPluginClassAttribute(null, "class");will allow this in the input xml: <root> <some-plugin class="com.acme.widget"> ......instead of the default syntax: <root> <some-plugin plugin-class="com.acme.widget"> ......This is particularly useful if the input xml document is not in English. Note that the xml attributes used by PluginDeclarationRules are not affected by this method. |
Example: setPluginIdAttribute(null, "id");will allow this in the input xml: <root> <some-plugin id="widget"> ......rather than the default behaviour: <root> <some-plugin plugin-id="widget"> ......This is particularly useful if the input xml document is not in English. Note that the xml attributes used by PluginDeclarationRules are not affected by this method. |
If the intent is just to add an additional rule-finding algorithm, then it may be better to call #getRuleFinders, and insert a new object into the start of the list. |