2.17.2: 2011-06-17

net.sf.basedb.util.extensions
Class ExtensionBean<A extends Action>

java.lang.Object
  extended by 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
private  About about
           
private  ActionFactory<? extends A> actionFactory
           
private  String extensionPoint
           
private  String id
           
private  float index
           
private  RendererFactory<? super A> rendererFactory
           
 
Constructor Summary
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
 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private String id

extensionPoint

private String extensionPoint

actionFactory

private ActionFactory<? extends A extends Action> actionFactory

rendererFactory

private RendererFactory<? super A extends Action> rendererFactory

about

private About about

index

private float index
Constructor Detail

ExtensionBean

public ExtensionBean()
Create a new empty extension bean. Use the setter methods to set the properties before registering the extension with Registry.registerExtension(Extension).


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 the Extension interface for a description of the parameters.

Method Detail

toString

public String toString()
Overrides:
toString in class Object

getId

public String getId()
Description copied from interface: Extension
Get the ID of the extension.

Specified by:
getId in interface Extension<A extends Action>
Returns:
A non-null unique identifier value

setId

public void setId(String id)

getExtends

public String getExtends()
Description copied from interface: Extension
Get the ID of the extension point this extension is extending.

Specified by:
getExtends in interface Extension<A extends Action>
Returns:
A non-null identifier value

setExtends

public void setExtends(String extensionPoint)

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 external ExtensionsFilter implementation.

Specified by:
getIndex in interface Extension<A extends Action>
Returns:
The index value

setIndex

public void setIndex(float index)

getActionFactory

public ActionFactory<? extends A> 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 the ExtensionPoint.getActionClass() method of the extended extension point returns.

Specified by:
getActionFactory in interface Extension<A extends Action>
Returns:
An action factory (required)

setActionFactory

public void setActionFactory(ActionFactory<? extends A> actionFactory)

getRendererFactory

public RendererFactory<? super A> 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 interface Extension<A extends Action>
Returns:
A renderer factory or null
See Also:
ExtensionPoint.allowRendererOverride()

setRendererFactory

public void setRendererFactory(RendererFactory<? super A> rendererFactory)

getAbout

public About 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.

Specified by:
getAbout in interface Extension<A extends Action>
Returns:
Optional information about the extension

setAbout

public void setAbout(About about)

2.17.2: 2011-06-17