Package net.sf.basedb.util.extensions
Class ExtensionBean<A extends Action>
java.lang.Object
net.sf.basedb.util.extensions.ExtensionBean<A>
- All Implemented Interfaces:
Extension<A>
public class ExtensionBean<A extends Action> extends Object implements Extension<A>
A bean-like implementation of the
Extension
interface.
This implementation adds setter methods for simple initialisation
of the bean properties.- Version:
- 2.7
- Author:
- nicklas
- Last modified
- $Date:2008-03-20 12:15:25 +0100 (Thu, 20 Mar 2008) $
-
Field Summary
Fields Modifier and Type Field Description private About
about
private ActionFactory<? extends A>
actionFactory
private String
extensionPoint
private String
id
private float
index
private RendererFactory<? super A>
rendererFactory
-
Constructor Summary
Constructors Constructor Description ExtensionBean()
Create a new empty extension bean.ExtensionBean(String id, String extensionPoint, float position, About about, ActionFactory<? extends A> actionFactory, RendererFactory<? super A> rendererFactory)
Create a new fully initialised extension bean. -
Method Summary
Modifier and Type Method Description About
getAbout()
Get information about the extensions.ActionFactory<? extends A>
getActionFactory()
Get the factory class for creating actions.String
getExtends()
Get the ID of the extension point this extension is extending.String
getId()
Get the ID of the extension.float
getIndex()
The extensions in an extension point are by default ordered by their index value.RendererFactory<? super A>
getRendererFactory()
Get an optional factory class for creating renderers for the actions.void
setAbout(About about)
void
setActionFactory(ActionFactory<? extends A> actionFactory)
void
setExtends(String extensionPoint)
void
setId(String id)
void
setIndex(float index)
void
setRendererFactory(RendererFactory<? super A> rendererFactory)
String
toString()
-
Field Details
-
id
-
extensionPoint
-
actionFactory
-
rendererFactory
-
about
-
index
private float index
-
-
Constructor Details
-
ExtensionBean
public ExtensionBean()Create a new empty extension bean. Use the setter methods to set the properties before registering the extension withRegistry.registerExtension(Extension, ClassLoader)
. -
ExtensionBean
public ExtensionBean(String id, String extensionPoint, float position, About about, ActionFactory<? extends A> actionFactory, RendererFactory<? super A> rendererFactory)Create a new fully initialised extension bean. See theExtension
interface for a description of the parameters.
-
-
Method Details
-
toString
-
getId
Description copied from interface:Extension
Get the ID of the extension. -
setId
-
getExtends
Description copied from interface:Extension
Get the ID of the extension point this extension is extending.- Specified by:
getExtends
in interfaceExtension<A extends Action>
- Returns:
- A non-null identifier value
-
setExtends
-
getIndex
public float getIndex()Description copied from interface:Extension
The extensions in an extension point are by default ordered by their index value. Extensions with a low value are ordered before extensions with a high value. The ordering may be overridden by providing an externalExtensionsFilter
implementation. -
setIndex
public void setIndex(float index) -
getActionFactory
Description copied from interface:Extension
Get the factory class for creating actions. The factory must create objects of the same class or a subclass as theExtensionPoint.getActionClass()
method of the extended extension point returns.- Specified by:
getActionFactory
in interfaceExtension<A extends Action>
- Returns:
- An action factory (required)
-
setActionFactory
-
getRendererFactory
Description copied from interface:Extension
Get an optional factory class for creating renderers for the actions. This factory will only be used if the extension point allows it.- Specified by:
getRendererFactory
in interfaceExtension<A extends Action>
- Returns:
- A renderer factory or null
- See Also:
ExtensionPoint.allowRendererOverride()
-
setRendererFactory
-
getAbout
Description copied from interface:Extension
Get information about the extensions. This is optional, but we recommend that at least some documentation and contact information is given. -
setAbout
-