Package org.cytoscape.work
Class AbstractTunableInterceptor<T extends TunableHandler>
- java.lang.Object
-
- org.cytoscape.work.AbstractTunableInterceptor<T>
-
- Type Parameters:
T
- The generic type of this AbstractTunableInterceptor.
public abstract class AbstractTunableInterceptor<T extends TunableHandler> extends Object
An abstract base class for TunableRecorder and TunableMutator implementations. This class provides a method for checking whether a field or method has been annotated withTunable
and another method for returning the appropriateTunableHandler
s for the field for method.
This class provides methods for adding and removingTunableHandlerFactory
OSGi services where theTunableHandler
s generated by the factory are of type T.Module:
work-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>work-api</artifactId> </dependency>
Cytoscape Backwards Compatibility (Abstract Class): This class is abstract and meant to be extended by users. This means that we may add methods for minor version updates. Methods will only be removed for major version updates.
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<Object,List<T>>
handlerMap
Store the Handlers.protected Map<Object,Method>
titleProviderMap
Store the title-returning methods.protected List<TunableHandlerFactory<T>>
tunableHandlerFactories
A list of TunableHandlerFactory services that have been registered.
-
Constructor Summary
Constructors Constructor Description AbstractTunableInterceptor()
Creates a new AbstractTunableInterceptor object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTunableHandlerFactory(TunableHandlerFactory<T> thf, Map properties)
Allows TunableHandlerFactory services to be added to the list of factories used to process Tunables.List<T>
getHandlers(Object o)
Returns a list ofTunableHandler
objects that have been found to process the fields and methods annotated withTunable
.boolean
hasTunables(Object o)
Tests an object to see if any of its fields or method haveTunable
annotations.void
removeTunableHandlerFactory(TunableHandlerFactory<T> thf, Map properties)
Allows TunableHandlerFactory services to be removed from the list of factories used to process Tunables.
-
-
-
Field Detail
-
handlerMap
protected final Map<Object,List<T extends TunableHandler>> handlerMap
Store the Handlers.
-
titleProviderMap
protected final Map<Object,Method> titleProviderMap
Store the title-returning methods.
-
tunableHandlerFactories
protected final List<TunableHandlerFactory<T extends TunableHandler>> tunableHandlerFactories
A list of TunableHandlerFactory services that have been registered.
-
-
Method Detail
-
getHandlers
public final List<T> getHandlers(Object o)
Returns a list ofTunableHandler
objects that have been found to process the fields and methods annotated withTunable
.- Parameters:
o
- The object whose fields and methods will be searched forTunable
annotations.- Returns:
- The list that contains all the
TunableHandler
objects that have been found to process the fields and methods annotated withTunable
.
-
hasTunables
public boolean hasTunables(Object o)
Tests an object to see if any of its fields or method haveTunable
annotations.
-
addTunableHandlerFactory
public void addTunableHandlerFactory(TunableHandlerFactory<T> thf, Map properties)
Allows TunableHandlerFactory services to be added to the list of factories used to process Tunables.- Parameters:
thf
- The factory to be added.properties
- OSGi service metadata. May be null.
-
removeTunableHandlerFactory
public void removeTunableHandlerFactory(TunableHandlerFactory<T> thf, Map properties)
Allows TunableHandlerFactory services to be removed from the list of factories used to process Tunables.- Parameters:
thf
- The factory to be removed.properties
- OSGi service metadata. May be null.
-
-