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 withTunableand another method for returning the appropriateTunableHandlers for the field for method.
This class provides methods for adding and removingTunableHandlerFactoryOSGi services where theTunableHandlers generated by the factory are of type T.Module:
work-apiTo 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>>handlerMapStore the Handlers.protected Map<Object,Method>titleProviderMapStore the title-returning methods.protected List<TunableHandlerFactory<T>>tunableHandlerFactoriesA 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 voidaddTunableHandlerFactory(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 ofTunableHandlerobjects that have been found to process the fields and methods annotated withTunable.booleanhasTunables(Object o)Tests an object to see if any of its fields or method haveTunableannotations.voidremoveTunableHandlerFactory(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 ofTunableHandlerobjects that have been found to process the fields and methods annotated withTunable.- Parameters:
o- The object whose fields and methods will be searched forTunableannotations.- Returns:
- The list that contains all the
TunableHandlerobjects 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 haveTunableannotations.
-
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.
-
-