Package org.scijava.io
Class AbstractTypedIOService<D>
- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.plugin.AbstractRichPlugin
-
- org.scijava.service.AbstractService
-
- org.scijava.plugin.AbstractPTService<PT>
-
- org.scijava.plugin.AbstractSingletonService<PT>
-
- org.scijava.plugin.AbstractHandlerService<Location,IOPlugin<D>>
-
- org.scijava.io.AbstractTypedIOService<D>
-
- All Implemented Interfaces:
Comparable<Prioritized>,Contextual,Disposable,Identifiable,Initializable,TypedIOService<D>,Locatable,Logged,HandlerService<Location,IOPlugin<D>>,HasPluginInfo,PTService<IOPlugin<D>>,RichPlugin,SciJavaPlugin,SingletonService<IOPlugin<D>>,TypedService<Location,IOPlugin<D>>,Prioritized,SciJavaService,Service,Typed<Location>,Versioned
- Direct Known Subclasses:
DefaultTextIOService
public abstract class AbstractTypedIOService<D> extends AbstractHandlerService<Location,IOPlugin<D>> implements TypedIOService<D>
Abstract base class for typedIOPlugins.- Author:
- Curtis Rueden, Deborah Schmidt
-
-
Constructor Summary
Constructors Constructor Description AbstractTypedIOService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanOpen(String source)booleancanOpen(Location source)booleancanSave(D data, String source)booleancanSave(D data, Location destination)protected IOServiceioService()protected LocationServicelocationService()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 class org.scijava.plugin.AbstractSingletonService
getInstance, getInstances, objectService, onEvent, onEvent
-
Methods inherited from class org.scijava.plugin.AbstractPTService
pluginService
-
Methods inherited from class org.scijava.service.AbstractService
getContext, setContext, toString
-
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
getInfo, getPriority, setInfo, setPriority
-
Methods inherited from class org.scijava.AbstractContextual
context
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
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.io.TypedIOService
getOpener, getOpener, getPluginType, getSaver, getSaver, getType
-
Methods inherited from interface org.scijava.plugin.TypedService
find
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
open
public D open(String source) throws IOException
Description copied from interface:TypedIOServiceLoads 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; seeTypedIOService.getOpener(String).- Specified by:
openin interfaceTypedIOService<D>- 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
public D open(Location source) throws IOException
Description copied from interface:TypedIOServiceLoads data from the given location.The opener to use is automatically determined based on available
IOPlugins; seeTypedIOService.getOpener(Location).- Specified by:
openin interfaceTypedIOService<D>- 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
public void save(D data, String destination) throws IOException
Description copied from interface:TypedIOServiceSaves 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; seeTypedIOService.getSaver(Object, String).- Specified by:
savein interfaceTypedIOService<D>- 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
public void save(D data, Location destination) throws IOException
Description copied from interface:TypedIOServiceSaves data to the given location.The saver to use is automatically determined based on available
IOPlugins; seeTypedIOService.getSaver(Object, Location).- Specified by:
savein interfaceTypedIOService<D>- 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
public boolean canOpen(String source)
- Specified by:
canOpenin interfaceTypedIOService<D>
-
canOpen
public boolean canOpen(Location source)
- Specified by:
canOpenin interfaceTypedIOService<D>
-
canSave
public boolean canSave(D data, String source)
- Specified by:
canSavein interfaceTypedIOService<D>
-
canSave
public boolean canSave(D data, Location destination)
- Specified by:
canSavein interfaceTypedIOService<D>
-
locationService
protected LocationService locationService()
-
ioService
protected IOService ioService()
-
-