Package org.scijava.io
Interface TypedIOService<D>
-
- All Superinterfaces:
Comparable<Prioritized>,Contextual,Disposable,HandlerService<Location,IOPlugin<D>>,HasPluginInfo,Identifiable,Initializable,Locatable,Logged,Prioritized,PTService<IOPlugin<D>>,RichPlugin,SciJavaPlugin,SciJavaService,Service,SingletonService<IOPlugin<D>>,Typed<Location>,TypedService<Location,IOPlugin<D>>,Versioned
- All Known Subinterfaces:
TextIOService
- All Known Implementing Classes:
AbstractTypedIOService,DefaultTextIOService
public interface TypedIOService<D> extends HandlerService<Location,IOPlugin<D>>, SciJavaService
Interface for high-level data I/O: opening and saving data of a specific type.- Author:
- Curtis Rueden, Deborah Schmidt
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description booleancanOpen(String source)booleancanOpen(Location source)booleancanSave(D data, String destination)booleancanSave(D data, Location destination)default IOPlugin<D>getOpener(String source)Gets the most appropriateIOPluginfor opening data from the given location.default IOPlugin<D>getOpener(Location source)Gets the most appropriateIOPluginfor opening data from the given location.default Class<IOPlugin<D>>getPluginType()Gets the type of plugins managed by this service.default IOPlugin<D>getSaver(D data, String destination)Gets the most appropriateIOPluginfor saving data to the given location.default IOPlugin<D>getSaver(D data, Location destination)Gets the most appropriateIOPluginfor saving data to the given location.default Class<Location>getType()Gets the type associated with the object.Dopen(String source)Loads data from the given source.Dopen(Location source)Loads data from the given location.voidsave(D data, String destination)Saves data to the given destination.voidsave(D data, Location destination)Saves data to the given location.-
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.HandlerService
getHandler, getInstances, supports
-
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
getPlugins, getPluginService, 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.SingletonService
create, filterInstances, getInstance, initialize, objectService
-
Methods inherited from interface org.scijava.plugin.TypedService
find
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
getOpener
default IOPlugin<D> getOpener(String source)
Gets the most appropriateIOPluginfor opening data from the given location.
-
getOpener
default IOPlugin<D> getOpener(Location source)
Gets the most appropriateIOPluginfor opening data from the given location.
-
getSaver
default IOPlugin<D> getSaver(D data, String destination)
Gets the most appropriateIOPluginfor saving data to the given location.
-
getSaver
default IOPlugin<D> getSaver(D data, Location destination)
Gets the most appropriateIOPluginfor saving data to the given location.
-
open
D open(String source) throws IOException
Loads data from the given source. For extensibility, the nature of the source is left intentionally general, but two common examples include file paths and URLs.The opener to use is automatically determined based on available
IOPlugins; seegetOpener(String).- Parameters:
source- The source (e.g., file path) from which to data should be loaded.- Returns:
- An object representing the loaded data, or null if the source is not supported.
- Throws:
IOException- if something goes wrong loading the data.
-
open
D open(Location source) throws IOException
Loads data from the given location.The opener to use is automatically determined based on available
IOPlugins; seegetOpener(Location).- Parameters:
source- The location from which to data should be loaded.- Returns:
- An object representing the loaded data, or null if the source is not supported.
- Throws:
IOException- if something goes wrong loading the data.
-
save
void save(D data, String destination) throws IOException
Saves data to the given destination. The nature of the destination is left intentionally general, but the most common example is a file path.The saver to use is automatically determined based on available
IOPlugins; seegetSaver(Object, String).- Parameters:
data- The data to be saved to the destination.destination- The destination (e.g., file path) to which data should be saved.- Throws:
IOException- if something goes wrong saving the data.
-
save
void save(D data, Location destination) throws IOException
Saves data to the given location.The saver to use is automatically determined based on available
IOPlugins; seegetSaver(Object, Location).- Parameters:
data- The data to be saved to the destination.destination- The destination location to which data should be saved.- Throws:
IOException- if something goes wrong saving the data.
-
canOpen
boolean canOpen(String source)
-
canOpen
boolean canOpen(Location source)
-
getPluginType
default Class<IOPlugin<D>> getPluginType()
Description copied from interface:PTServiceGets the type of plugins managed by this service.- Specified by:
getPluginTypein interfacePTService<D>
-
-