Package net.sf.basedb.util.extensions
Class Registry.RegisteredExtensionPoint<A extends Action>
java.lang.Object
net.sf.basedb.util.extensions.Registry.RegisteredExtensionPoint<A>
- All Implemented Interfaces:
ExtensionPoint<A>
- Enclosing class:
- Registry
static class Registry.RegisteredExtensionPoint<A extends Action>
extends Object
implements ExtensionPoint<A>
Internal representation of an extension point.
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private ClassLoader
private String
private ErrorHandlerFactory<? super A>
private final Map<String,
Registry.RegisteredExtension<A>> private final String
private Throwable
private A
private String
private RendererFactory<? super A>
-
Constructor Summary
ConstructorDescriptionRegisteredExtensionPoint
(ExtensionPoint<A> ep, ClassLoader classLoader) Create a new registered extension point by copying the information from the parameter. -
Method Summary
Modifier and TypeMethodDescription(package private) void
addExtension
(Registry.RegisteredExtension<A> extension) Add an extension to this extension point.boolean
If an extension is allowed to override the renderer factory with an implementation of its own.(package private) void
Get the class object that represents the type of action that can be added to this extension point.(package private) ClassLoader
Get a description of the extension point.ErrorHandlerFactory<? super A>
Get the error handler factory that should be used with this extension point.(package private) Collection<Registry.RegisteredExtension<A>>
Get all extensions registered with this extension point.getId()
Get the ID of the extension point.(package private) Throwable
getName()
Get the name of the extension point.RendererFactory<? super A>
This is an optional factory for creatingRenderer
instances.(package private) void
Remove the extension with a given ID.(package private) void
toString()
(package private) void
update
(ExtensionPoint<A> ep, ClassLoader classLoader) Update the registered information.
-
Field Details
-
id
-
actionClass
-
extensions
-
name
-
description
-
rendererFactory
-
allowRendererOverride
private boolean allowRendererOverride -
errorHandlerFactory
-
classLoader
-
lastError
-
lastErrorAction
-
-
Constructor Details
-
RegisteredExtensionPoint
RegisteredExtensionPoint(ExtensionPoint<A> ep, ClassLoader classLoader) Create a new registered extension point by copying the information from the parameter.
-
-
Method Details
-
getId
Description copied from interface:ExtensionPoint
Get the ID of the extension point.- Specified by:
getId
in interfaceExtensionPoint<A extends Action>
- Returns:
- A non-null unique identifier value
-
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 interfaceExtensionPoint<A extends Action>
-
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 interfaceExtensionPoint<A extends Action>
- Returns:
- An optional description
-
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 theAction
interface. Extensions that are extending this extension point must provide anActionFactory
that is capable of creating instances of the specified class.- Specified by:
getActionClass
in interfaceExtensionPoint<A extends Action>
- Returns:
- The class of the actions that can be used on this extension point (required)
-
getRendererFactory
Description copied from interface:ExtensionPoint
This is an optional factory for creatingRenderer
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 interfaceExtensionPoint<A extends Action>
- Returns:
- A renderer factory or null
-
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 interfaceExtensionPoint<A extends Action>
- Returns:
- TRUE to allow extensions to override, FALSE otherwise
-
getErrorHandlerFactory
Description copied from interface:ExtensionPoint
Get the error handler factory that should be used with this extension point.- Specified by:
getErrorHandlerFactory
in interfaceExtensionPoint<A extends Action>
- Returns:
- An error handler factory, or null to use the system default
-
toString
-
update
Update the registered information. -
addExtension
Add an extension to this extension point. -
removeExtension
Remove the extension with a given ID. -
getExtensions
Collection<Registry.RegisteredExtension<A>> getExtensions()Get all extensions registered with this extension point. -
getClassLoader
ClassLoader getClassLoader()- Since:
- 3.2
-
setError
-
clearError
void clearError() -
getLastError
Throwable getLastError()
-