Class SelfNamedPlugin
- java.lang.Object
-
- org.dspace.core.SelfNamedPlugin
-
- Direct Known Subclasses:
DCInputAuthority,DSpaceControlledVocabulary,MODSDisseminationCrosswalk,PDFPackager,QDCCrosswalk,SimpleDCDisseminationCrosswalk,XHTMLHeadDisseminationCrosswalk,XSLTCrosswalk
public abstract class SelfNamedPlugin extends Object
Simple lightweight "framework" for managing plugins.This is a superclass of all classes which are managed as self-named plugins. They must extend
SelfNamedPluginor its subclass.Unfortunately, this has to be an
abstract classbecause aninterfacemay not have static methods. ThepluginAliasesmethod is static so it can be invoked without creating an instance, and thus let the aliases live in the class itself so there is no need for name mapping in a separate configuration file.See the documentation in the
PluginServiceclass for more details.- Version:
- $Revision$
- Author:
- Larry Stone
- See Also:
PluginService
-
-
Constructor Summary
Constructors Constructor Description SelfNamedPlugin()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetPluginInstanceName()Get an instance's particular name.static String[]getPluginNames()Get the names of this plugin implementation.protected voidsetPluginInstanceName(String name)Set the name under which this plugin was instantiated.
-
-
-
Method Detail
-
getPluginNames
public static String[] getPluginNames()
Get the names of this plugin implementation. Returns all names to which this plugin answers.A name should be a short generic name illustrative of the service, e.g.
"PDF","JPEG","GIF"for media filters.Each name must be unique among all the plugins implementing any given interface, but it can be the same as a name of a plugin for a different interface. For example, two classes may each have a
"default"name if they do not implement any of the same interfaces.- Returns:
- array of names of this plugin
-
getPluginInstanceName
public String getPluginInstanceName()
Get an instance's particular name. Returns the name by which the class was chosen when this instance was created. Only works for instances created byPluginService, or if someone remembers to callsetPluginName.Useful when the implementation class wants to be configured differently when it is invoked under different names.
- Returns:
- name or null if not available.
-
setPluginInstanceName
protected void setPluginInstanceName(String name)
Set the name under which this plugin was instantiated. Not to be invoked by application code, it is called automatically byPluginService.getNamedPlugin()when the plugin is instantiated.- Parameters:
name- -- name used to select this class.
-
-