Package org.scijava.plugin
Interface WrapperService<DT,PT extends WrapperPlugin<DT>>
-
- Type Parameters:
DT- Base data typePT- Plugin type
- All Superinterfaces:
Comparable<Prioritized>,Contextual,Disposable,HasPluginInfo,Identifiable,Initializable,Locatable,Logged,Prioritized,PTService<PT>,RichPlugin,SciJavaPlugin,Service,Typed<DT>,TypedService<DT,PT>,Versioned
- All Known Subinterfaces:
DataHandleService,WidgetService
- All Known Implementing Classes:
AbstractWrapperService,DefaultDataHandleService,DefaultWidgetService
public interface WrapperService<DT,PT extends WrapperPlugin<DT>> extends TypedService<DT,PT>
A service for managingWrapperPlugins of a particular type. AWrapperPluginis a statefulTypedPluginwhich wraps a particular object of its associated data type. For any given data object, the service is capable of wrapping it with the most appropriate wrapper by sequentially querying eachWrapperPluginon its list for compatibility.Note that like
PTService,SingletonServiceandTypedService,WrapperServiceis not a service interface defining API for a specific concrete service implementation, but rather a more general layer in a type hierarchy intended to ease creation of services that fit its pattern.- Author:
- Curtis Rueden
- See Also:
WrapperPlugin,PTService
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default <D extends DT>
PTcreate(D data)Creates a new plugin instance wrapping the given associated data object.default voidinitialize()Performs any needed initialization when the service is first loaded.default booleansupports(DT data)Gets whether this object is compatible with the given data object.-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.Disposable
dispose
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.PTService
create, getPlugins, getPluginService, getPluginType, pluginService
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
registerEventHandlers
-
Methods inherited from interface org.scijava.plugin.TypedService
find
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
create
default <D extends DT> PT create(D data)
Creates a new plugin instance wrapping the given associated data object.- Returns:
- An appropriate plugin instance, or null if the data is not compatible with any available plugin.
-
initialize
default void initialize()
Description copied from interface:ServicePerforms any needed initialization when the service is first loaded.NB: This method is not intended to be called directly. It is called by the service framework itself (specifically by the
ServiceHelper) when initializing the service. It should not be called a second time.- Specified by:
initializein interfaceInitializable- Specified by:
initializein interfaceService
-
supports
default boolean supports(DT data)
Description copied from interface:TypedGets whether this object is compatible with the given data object.By default, this method will return
trueiff the data is assignable to the associated type given byTyped.getType(). But individual implementations may have other requirements beyond class assignability.
-
-