Package org.cytoscape.work
Interface TunableHandlerFactory<T extends TunableHandler>
-
- Type Parameters:
T
- The specific type ofTunableHandler
that will be created by this factory.
- All Known Subinterfaces:
GUITunableHandlerFactory<T>
,StringTunableHandlerFactory<T>
,TunablePropertyHandlerFactory<T>
- All Known Implementing Classes:
BasicTunableHandlerFactory
,SimpleGUITunableHandlerFactory
public interface TunableHandlerFactory<T extends TunableHandler>
A factory service to create aTunableHandler
for a single type of object, determined by the type of the field or the return value of the getter method in the appropriate methods. Each type of object (int, float, String) generally needs a different implementation of this interface. Each implementation is expected to be registered as an OSGi service. TunableInterceptors register the TunableHandlerFactory services of the appropriate type.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 (SPI Interface): We expect that this interface will be implemented. Therefore to maintain backwards compatibility this interface will only be modified for major version updates.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
createTunableHandler(Field field, Object instance, Tunable tunable)
This method returns aTunableHandler
for a field annotated as aTunable
if this factory can produce an appropriate handler for this type of field.T
createTunableHandler(Method getter, Method setter, Object instance, Tunable tunable)
This method returns aTunableHandler
for a method annotated as aTunable
if this factory can produce an appropriate handler for this type of method.
-
-
-
Method Detail
-
createTunableHandler
T createTunableHandler(Field field, Object instance, Tunable tunable)
This method returns aTunableHandler
for a field annotated as aTunable
if this factory can produce an appropriate handler for this type of field. If the factory cannot produce an appropriate handler, it will return null.- Parameters:
field
- Field that needs to be handled.instance
- The object on which we want to read/write the Field.tunable
- Tunable that contains all the information concerning the user interface.- Returns:
- T The newly constructed
TunableHandler
or null if this factory can't handle a field of the specified type.
-
createTunableHandler
T createTunableHandler(Method getter, Method setter, Object instance, Tunable tunable)
This method returns aTunableHandler
for a method annotated as aTunable
if this factory can produce an appropriate handler for this type of method. If the factory cannot produce an appropriate handler, it will return null.
Note that method annotations require both a getter and a setter method to get and set a value. Only the getter method needs to be annotated. The getter method must take no arguments and return a value and be named with the prefix "get". The setter method does not need aTunable
annotation, however the method must take a single argument of the same type as the getter method, it must return void, it must be named with the prefix "set", and the rest of the name must match that of the getter method. SeeTunable
for an example.- Parameters:
getter
- A getter method that has been annotated withTunable
.setter
- A setter method that matches the getter method.instance
- The object on which we want to invoke thegetter
andsetter
methods.tunable
- The Tunable that contains all the information concerning the user interface from the getter method.- Returns:
- T The newly constructed
TunableHandler
or null if this factory can't handle the specified type.
-
-