|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.specrunner.plugins.core.factories.PluginFactoryImpl
public abstract class PluginFactoryImpl
Partial plugin factory implementation.
| Field Summary | |
|---|---|
protected Map<String,String> |
aliasToTypeNames
Map from alias to class name. |
protected Map<String,Class<? extends IPlugin>> |
aliasToTypes
Map from alias to types. |
protected Map<String,IPlugin> |
templates
Map from alias to templates. |
protected Map<String,String> |
typeNamesToAlias
Map from alias to names. |
| Constructor Summary | |
|---|---|
protected |
PluginFactoryImpl(String file,
PluginKind kind)
Creates a factory loading the given file. |
| Method Summary | |
|---|---|
IPluginFactory |
bind(PluginKind kind,
String alias,
IPlugin plugin)
Bind a plugin instance to a given kind. |
boolean |
finalizePlugin(nu.xom.Node source,
IContext context,
IPlugin plugin)
Finalize a plugin. |
String |
getAlias(Class<? extends IPlugin> type)
Given a class, for example, return the corresponding alias for the plugin. |
Class<? extends IPlugin> |
getClass(String alias)
Given a name, return the corresponding plugin class associated. i.e. |
PluginKind |
getKind()
Get the kind to factory. |
void |
initialize()
Initialize the factory. |
protected boolean |
test(PluginKind type)
Test if the factory accept the plugin. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.specrunner.plugins.IPluginFactory |
|---|
newPlugin |
| Field Detail |
|---|
protected Map<String,String> aliasToTypeNames
protected Map<String,Class<? extends IPlugin>> aliasToTypes
protected Map<String,IPlugin> templates
protected Map<String,String> typeNamesToAlias
| Constructor Detail |
|---|
protected PluginFactoryImpl(String file,
PluginKind kind)
file - The file to be loaded.kind - The factory kind.| Method Detail |
|---|
public PluginKind getKind()
public void initialize()
throws PluginException
PluginException - On initialization errors.
public Class<? extends IPlugin> getClass(String alias)
throws PluginException
IPluginFactory
getClass in interface IPluginFactoryalias - The plugin alias.
PluginException - On reference lookup failure.
public String getAlias(Class<? extends IPlugin> type)
throws PluginException
IPluginFactory
getAlias in interface IPluginFactorytype - The plugin type, i.e. 'PluginInclude.class',
'PluginConnection', etc.
PluginException - On alias lookup name failure.
public IPluginFactory bind(PluginKind kind,
String alias,
IPlugin plugin)
throws PluginException
IPluginFactory
bind in interface IPluginFactorykind - The plugin kind.alias - The alias.plugin - The plugin instance.
PluginException - On bind errors.protected boolean test(PluginKind type)
type - The plugin type.
true, if accept the type, false,
otherwise.
public boolean finalizePlugin(nu.xom.Node source,
IContext context,
IPlugin plugin)
throws PluginException
IPluginFactory
finalizePlugin in interface IPluginFactorysource - The source Node..context - The context.plugin - The previously created plugin for this node.
PluginException - On finalization error.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||