Package | Description |
---|---|
org.apache.commons.digester.plugins |
The
plugins package provides an easy mechanism whereby new
digestion rules can be added dynamically during a digestion. |
org.apache.commons.digester.plugins.strategies |
The
plugins.strategies package contains "rule-finding" strategy
classes, and their associated "helper" loader classes. |
Modifier and Type | Class and Description |
---|---|
class |
PluginInvalidInputException
Thrown when an error occurs due to bad data in the file being parsed.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
RuleLoader.addRules(Digester d,
java.lang.String path)
Configures the digester with custom rules for some plugged-in
class.
|
void |
Declaration.configure(Digester digester,
java.lang.String pattern)
Attempt to load custom rules for the target class at the specified
pattern.
|
static void |
PluginDeclarationRule.declarePlugin(Digester digester,
java.util.Properties props) |
abstract RuleLoader |
RuleFinder.findLoader(Digester d,
java.lang.Class<?> pluginClass,
java.util.Properties p)
Apply the finder algorithm to attempt to locate a source of
digester rules for the specified plugin class.
|
RuleLoader |
PluginManager.findLoader(Digester digester,
java.lang.String id,
java.lang.Class<?> pluginClass,
java.util.Properties props)
Given a plugin class and some associated properties, scan the
list of known RuleFinder instances until one detects a source of
custom rules for this plugin (aka a RuleLoader).
|
void |
Declaration.init(Digester digester,
PluginManager pm)
Must be called exactly once, and must be called before any call
to the configure method.
|
abstract Rules |
RulesFactory.newRules(Digester d,
java.lang.Class<?> pluginClass)
Return an instance of some Rules implementation that the plugged-in
class shall use to match its private parsing rules.
|
Constructor and Description |
---|
PluginRules(Digester digester,
java.lang.String mountPoint,
PluginRules parent,
java.lang.Class<?> pluginClass)
Constructs a Rules instance which has a parent Rules object
(which is different from having a delegate rules object).
|
Modifier and Type | Method and Description |
---|---|
void |
LoaderFromClass.addRules(Digester d,
java.lang.String path)
Just invoke the target method.
|
void |
LoaderFromStream.addRules(Digester d,
java.lang.String path)
Add the rules previously loaded from the input stream into the
specified digester.
|
RuleLoader |
FinderFromClass.findLoader(Digester digester,
java.lang.Class<?> pluginClass,
java.util.Properties p)
If there exists a property with the name matching constructor param
ruleClassAttr, then load the specified class, locate the appropriate
rules-adding method on that class, and return an object encapsulating
that info.
|
RuleLoader |
FinderFromDfltResource.findLoader(Digester d,
java.lang.Class<?> pluginClass,
java.util.Properties p)
If there exists a resource file whose name is equal to the plugin
class name + the suffix specified in the constructor, then
load that file, run it through the xmlrules module and return an object
encapsulating those rules.
|
RuleLoader |
FinderFromDfltClass.findLoader(Digester digester,
java.lang.Class<?> pluginClass,
java.util.Properties p)
If there exists a class whose name is the plugin class name + the
suffix specified to the constructor, then load that class, locate
the appropriate rules-adding method on that class, and return an
object encapsulating that info.
|
RuleLoader |
FinderFromResource.findLoader(Digester d,
java.lang.Class<?> pluginClass,
java.util.Properties p)
If there exists a property with the name matching constructor param
resourceAttr, then load that file, run it through the xmlrules
module and return an object encapsulating those rules.
|
RuleLoader |
FinderFromDfltMethod.findLoader(Digester d,
java.lang.Class<?> pluginClass,
java.util.Properties p)
If there exists on the plugin class a method with name matching the
constructor's methodName value then locate the appropriate Method on
the plugin class and return an object encapsulating that info.
|
RuleLoader |
FinderFromMethod.findLoader(Digester d,
java.lang.Class<?> pluginClass,
java.util.Properties p)
If there exists a property with the name matching constructor param
methodAttr, then locate the appropriate Method on the plugin class
and return an object encapsulating that info.
|
RuleLoader |
FinderFromFile.findLoader(Digester d,
java.lang.Class<?> pluginClass,
java.util.Properties p)
If there exists a property with the name specified in the constructor,
then load that file, run it through the xmlrules module and return an
object encapsulating those rules.
|
static RuleLoader |
FinderFromResource.loadRules(Digester d,
java.lang.Class<?> pluginClass,
java.io.InputStream is,
java.lang.String resourceName)
Open the specified resource file (ie a file in the classpath,
including being within a jar in the classpath), run it through
the xmlrules module and return an object encapsulating those rules.
|
static java.lang.reflect.Method |
LoaderFromClass.locateMethod(java.lang.Class<?> rulesClass,
java.lang.String methodName)
Find a method on the specified class whose name matches methodName,
and whose signature is:
public static void foo(Digester d, String patternPrefix); . |
Constructor and Description |
---|
LoaderFromClass(java.lang.Class<?> rulesClass,
java.lang.String methodName)
Constructor.
|