Package org.ametys.runtime.plugin
Class AbstractExtensionPoint<T>
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.runtime.plugin.AbstractExtensionPoint<T>
-
- Type Parameters:
T
- the type of the managed extensions
- All Implemented Interfaces:
LogEnabled
,ExtensionPoint<T>
,Initializable
,Component
- Direct Known Subclasses:
DocbookEnhancementExtensionPoint
,HTMLEnhancementExtensionPoint
,XHTMLSerializerExtensionPoint
public abstract class AbstractExtensionPoint<T> extends AbstractLogEnabled implements ExtensionPoint<T>, Initializable, Component
Abstract implementation of an extension point.
Contains only helper methods. Tha actual job has to be done in theExtensionPoint.addExtension(String, String, String, org.apache.avalon.framework.configuration.Configuration)
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,T>
_extensions
Map containing the extensions.
The key is the unique id of the extension.
-
Constructor Summary
Constructors Constructor Description AbstractExtensionPoint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
getExtension(String id)
Returns the named extensionSet<String>
getExtensionsIds()
Returns a Set containing the ids of all known extensionsboolean
hasExtension(String id)
Returns true if the named extension existsvoid
initialize()
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.runtime.plugin.ExtensionPoint
addExtension, initializeExtensions
-
-
-
-
Field Detail
-
_extensions
protected Map<String,T> _extensions
Map containing the extensions.
The key is the unique id of the extension.
-
-
Constructor Detail
-
AbstractExtensionPoint
public AbstractExtensionPoint()
-
-
Method Detail
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
getExtension
public T getExtension(String id)
Description copied from interface:ExtensionPoint
Returns the named extension- Specified by:
getExtension
in interfaceExtensionPoint<T>
- Parameters:
id
- the unique id of the extension- Returns:
- the named extension
-
getExtensionsIds
public Set<String> getExtensionsIds()
Description copied from interface:ExtensionPoint
Returns a Set containing the ids of all known extensions- Specified by:
getExtensionsIds
in interfaceExtensionPoint<T>
- Returns:
- a Set containing the ids of all known extensions
-
hasExtension
public boolean hasExtension(String id)
Description copied from interface:ExtensionPoint
Returns true if the named extension exists- Specified by:
hasExtension
in interfaceExtensionPoint<T>
- Parameters:
id
- the unique id of the extension- Returns:
- true if the named extension exists
-
-