public class MasterFilterHelper<T extends org.scijava.Contextual> extends AbstractFilter<T> implements MasterFilter<T>
MasterFilter implementations. Takes
the place of an abstract superclass for containing boilerplate code.
As all MasterFilter implementations are also Filters, it
makes sense for concrete implementations of the former to be free to inherit
from abstract implementations of the latter. Thus, any boilerplate code that
would be common to all MasterFilter implementations, regardless of
their wrapped type, must go in a helper class to avoid multiple inheritance
conflicts.
On construction, all Filter classes annotated with Plugin are
discovered by the SciJava Common framework. All items whose
wrappedClass() return the same class as was used to construct this
MasterFilterHelper will be added to the list of filters for future
use. Filters are initially enabled or disabled based on their
isDefaultEnabled() annotation return value.
Filters can be enabled or disabled using the enable(Class) and
disable(Class) methods. This process can be done in any order, as
execution ordering of enabled filters is maintained automatically per their
natural order.
MasterFilter,
Filter| Constructor and Description |
|---|
MasterFilterHelper(T wrapped,
Class<? extends T> wrappedClass) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
disable(Class<? extends Filter> filterClass)
Removes the specified filter from the filter stack, if present.
|
<F extends Filter> |
enable(Class<F> filterClass)
Inserts an instance of the indicated filter class into the filter stack.
|
Set<Class<? extends Filter>> |
getFilterClasses()
Returns a list of all filter classes this MasterFilter can enable/disable.
|
T |
getTail()
Returns the base object (below the filter stack).
|
void |
reset()
Clears any configuration performed on this filter.
|
Class<?> |
target() |
enabledDefault, getParent, isCompatible, setParentgetVersion, loggetInfo, getPriority, setInfo, setPriority, toStringcontext, getContextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetParent, setParentenabledDefault, isCompatiblegetVersion, loggetIdentifiercontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationpublic <F extends Filter> F enable(Class<F> filterClass)
MasterFilterenable in interface MasterFilter<T extends org.scijava.Contextual>filterClass - - The type of filter to enablepublic boolean disable(Class<? extends Filter> filterClass)
MasterFilterdisable in interface MasterFilter<T extends org.scijava.Contextual>filterClass - - The type of filter to disablepublic T getTail()
MasterFiltergetTail in interface MasterFilter<T extends org.scijava.Contextual>public Class<?> target()
public void reset()
Filterreset in interface Filterreset in interface MasterFilter<T extends org.scijava.Contextual>reset in class AbstractFilter<T extends org.scijava.Contextual>public Set<Class<? extends Filter>> getFilterClasses()
MasterFiltergetFilterClasses in interface MasterFilter<T extends org.scijava.Contextual>Copyright © 2011–2026 SCIFIO. All rights reserved.