public class PluginManager
extends java.lang.Object
One instance of this class exists per PluginRules instance.
Modifier and Type | Field and Description |
---|---|
private java.util.HashMap<java.lang.String,Declaration> |
declarationsByClass
Map of classname->Declaration
|
private java.util.HashMap<java.lang.String,Declaration> |
declarationsById
Map of id->Declaration
|
private PluginManager |
parent
the parent manager to which this one may delegate lookups.
|
private PluginContext |
pluginContext
The object containing data that should only exist once for each
Digester instance.
|
Constructor and Description |
---|
PluginManager(PluginContext r)
Construct a "root" PluginManager, ie one with no parent.
|
PluginManager(PluginManager parent)
Construct a "child" PluginManager.
|
Modifier and Type | Method and Description |
---|---|
void |
addDeclaration(Declaration decl)
Add the declaration to the set of known declarations.
|
RuleLoader |
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).
|
Declaration |
getDeclarationByClass(java.lang.String className)
Return the declaration object with the specified class.
|
Declaration |
getDeclarationById(java.lang.String id)
Return the declaration object with the specified id.
|
private java.util.HashMap<java.lang.String,Declaration> declarationsByClass
private java.util.HashMap<java.lang.String,Declaration> declarationsById
private PluginManager parent
private PluginContext pluginContext
public PluginManager(PluginContext r)
public PluginManager(PluginManager parent)
parent
- must be non-null.public void addDeclaration(Declaration decl)
TODO: somehow get a reference to a Digester object so that we can really log here. Currently, all logging is disabled from this method.
decl
- an object representing a plugin class.public Declaration getDeclarationByClass(java.lang.String className)
public Declaration getDeclarationById(java.lang.String id)
id
- Description of the Parameterpublic RuleLoader findLoader(Digester digester, java.lang.String id, java.lang.Class<?> pluginClass, java.util.Properties props) throws PluginException
If no source of custom rules can be found, null is returned.
PluginException