Package net.sf.basedb.util.extensions
Class DefaultFilter
- java.lang.Object
-
- net.sf.basedb.util.extensions.DefaultFilter
-
- All Implemented Interfaces:
ExtensionsFilter
- Direct Known Subclasses:
Settings
public class DefaultFilter extends Object implements ExtensionsFilter
A default filter implementation that enables all extensions and extension points and sorts the extensions based on theExtension.getIndex()
values.- 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 static Comparator<InvokationContext<?>>
INDEX_COMPARATOR_CTX
Comparator used to order a list of invokation contexts by the index value of the extension.static Comparator<Extension<?>>
INDEX_COMPARATOR_EXT
Comparator used to order a list of extensions by the index value of the extension.
-
Constructor Summary
Constructors Constructor Description DefaultFilter()
Create a new default filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isEnabled(Extension<?> extension)
Check if an extension is enabled or disabled.boolean
isEnabled(ExtensionPoint<?> extensionPoint)
Check if an extension point is enabled or disabled.void
sort(List<? extends InvokationContext<?>> extensions)
Sort a list of invoked extensions according to some property.
-
-
-
Field Detail
-
INDEX_COMPARATOR_CTX
public static final Comparator<InvokationContext<?>> INDEX_COMPARATOR_CTX
Comparator used to order a list of invokation contexts by the index value of the extension.- See Also:
Extension.getIndex()
-
INDEX_COMPARATOR_EXT
public static final Comparator<Extension<?>> INDEX_COMPARATOR_EXT
Comparator used to order a list of extensions by the index value of the extension.- See Also:
Extension.getIndex()
-
-
Method Detail
-
isEnabled
public boolean isEnabled(ExtensionPoint<?> extensionPoint)
Description copied from interface:ExtensionsFilter
Check if an extension point is enabled or disabled.- Specified by:
isEnabled
in interfaceExtensionsFilter
- Parameters:
extensionPoint
- The extension point to check- Returns:
- TRUE if the extension point is enabled, FALSE if it is disabled
-
isEnabled
public boolean isEnabled(Extension<?> extension)
Description copied from interface:ExtensionsFilter
Check if an extension is enabled or disabled.- Specified by:
isEnabled
in interfaceExtensionsFilter
- Parameters:
extension
- The extension to check- Returns:
- TRUE if the extension is enabled, FALSE if it is disabled
-
sort
public void sort(List<? extends InvokationContext<?>> extensions)
Description copied from interface:ExtensionsFilter
Sort a list of invoked extensions according to some property.- Specified by:
sort
in interfaceExtensionsFilter
- Parameters:
extensions
- The list of extensions to sort
-
-