2.17.2: 2011-06-17

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

java.lang.Object
  extended by net.sf.basedb.util.extensions.ExtensionPointBean<A>
All Implemented Interfaces:
ExtensionPoint<A>

public class ExtensionPointBean<A extends Action>
extends Object
implements ExtensionPoint<A>

A bean-like implementation of the ExtensionPoint 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  Class<A> actionClass
           
private  boolean allowRendererOverride
           
private  String description
           
private  ErrorHandlerFactory<? super A> errorHandlerFactory
           
private  String id
           
private  String name
           
private  RendererFactory<? super A> rendererFactory
           
 
Constructor Summary
ExtensionPointBean()
          Create a new empty extension point bean.
ExtensionPointBean(String id, String name, String description, Class<A> actionClass, RendererFactory<A> rendererFactory, boolean allowRendererOverride)
          Create a new fully initialised extension point bean.
 
Method Summary
 boolean allowRendererOverride()
          If an extension is allowed to override the renderer factory with an implementation of its own.
 Class<A> getActionClass()
          Get the class object that represents the type of action that can be added to this extension point.
 String getDescription()
          Get a description of the extension point.
 ErrorHandlerFactory<? super A> getErrorHandlerFactory()
          Get the error handler factory that should be used with this extension point.
 String getId()
          Get the ID of the extension point.
 String getName()
          Get the name of the extension point.
 RendererFactory<? super A> getRendererFactory()
          This is an optional factory for creating Renderer instances.
 void setActionClass(Class<A> actionClass)
           
 void setAllowRendererOverrider(boolean allowRendererOverride)
           
 void setDescription(String description)
           
 void setErrorHandlerFactory(ErrorHandlerFactory<? super A> errorHandlerFactory)
           
 void setId(String id)
           
 void setName(String name)
           
 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

name

private String name

description

private String description

actionClass

private Class<A extends Action> actionClass

rendererFactory

private RendererFactory<? super A extends Action> rendererFactory

allowRendererOverride

private boolean allowRendererOverride

errorHandlerFactory

private ErrorHandlerFactory<? super A extends Action> errorHandlerFactory
Constructor Detail

ExtensionPointBean

public ExtensionPointBean()
Create a new empty extension point bean. Use the setter methods to set the properties before registering the extension with Registry.registerExtensionPoint(ExtensionPoint).


ExtensionPointBean

public ExtensionPointBean(String id,
                          String name,
                          String description,
                          Class<A> actionClass,
                          RendererFactory<A> rendererFactory,
                          boolean allowRendererOverride)
Create a new fully initialised extension point bean. See the ExtensionPoint 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: ExtensionPoint
Get the ID of the extension point.

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

setId

public void setId(String id)

getName

public String getName()
Description copied from interface: ExtensionPoint
Get the name of the extension point. This is just for display purposes and the value is optional. If no name is given the ID can be used instead.

Specified by:
getName in interface ExtensionPoint<A extends Action>

setName

public void setName(String name)

getDescription

public String getDescription()
Description copied from interface: ExtensionPoint
Get a description of the extension point. This value is optional but we recommend that the description contains a text documenting the extension point and has information that is useful for everyone who wants to implement extensions for the extension point. This should include context specific information.

Specified by:
getDescription in interface ExtensionPoint<A extends Action>
Returns:
An optional description

setDescription

public void setDescription(String description)

getActionClass

public Class<A> getActionClass()
Description copied from interface: ExtensionPoint
Get the class object that represents the type of action that can be added to this extension point. The class must implement the Action interface. Extensions that are extending this extension point must provide an ActionFactory that is capable of creating instances of the specified class.

Specified by:
getActionClass in interface ExtensionPoint<A extends Action>
Returns:
The class of the actions that can be used on this extension point (required)

setActionClass

public void setActionClass(Class<A> actionClass)

getRendererFactory

public RendererFactory<? super A> getRendererFactory()
Description copied from interface: ExtensionPoint
This is an optional factory for creating Renderer instances. Renderers are not a required part of the extension system, but will make it easier to write the code for extension points.

Specified by:
getRendererFactory in interface ExtensionPoint<A extends Action>
Returns:
A renderer factory or null

setRendererFactory

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

allowRendererOverride

public boolean allowRendererOverride()
Description copied from interface: ExtensionPoint
If an extension is allowed to override the renderer factory with an implementation of its own. This can be seen as a possibility where extensions can create their own look and feel. If strict compliance is needed overriding should of course not be allowed.

Specified by:
allowRendererOverride in interface ExtensionPoint<A extends Action>
Returns:
TRUE to allow extensions to override, FALSE otherwise

setAllowRendererOverrider

public void setAllowRendererOverrider(boolean allowRendererOverride)

getErrorHandlerFactory

public ErrorHandlerFactory<? super A> getErrorHandlerFactory()
Description copied from interface: ExtensionPoint
Get the error handler factory that should be used with this extension point.

Specified by:
getErrorHandlerFactory in interface ExtensionPoint<A extends Action>
Returns:
An error handler factory, or null to use the system default

setErrorHandlerFactory

public void setErrorHandlerFactory(ErrorHandlerFactory<? super A> errorHandlerFactory)

2.17.2: 2011-06-17