public abstract class AbstractTypedIOService<D> extends AbstractHandlerService<Location,IOPlugin<D>> implements TypedIOService<D>
IOPlugin
s.Constructor and Description |
---|
AbstractTypedIOService() |
Modifier and Type | Method and Description |
---|---|
boolean |
canOpen(Location source) |
boolean |
canOpen(String source) |
boolean |
canSave(D data,
Location destination) |
boolean |
canSave(D data,
String source) |
protected IOService |
ioService() |
protected LocationService |
locationService() |
D |
open(Location source)
Loads data from the given location.
|
D |
open(String source)
Loads data from the given source.
|
void |
save(D data,
Location destination)
Saves data to the given location.
|
void |
save(D data,
String destination)
Saves data to the given destination.
|
getInstance, getInstances, objectService, onEvent, onEvent
pluginService
getContext, setContext, toString
getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getOpener, getOpener, getPluginType, getSaver, getSaver, getType
getHandler, getInstances, supports
create, filterInstances, getInstance, initialize, objectService
find
getPlugins, getPluginService, pluginService
registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
public D open(String source) throws IOException
TypedIOService
The opener to use is automatically determined based on available
IOPlugin
s; see TypedIOService.getOpener(String)
.
open
in interface TypedIOService<D>
source
- The source (e.g., file path) from which to data should be
loaded.IOException
- if something goes wrong loading the data.public D open(Location source) throws IOException
TypedIOService
The opener to use is automatically determined based on available
IOPlugin
s; see TypedIOService.getOpener(Location)
.
open
in interface TypedIOService<D>
source
- The location from which to data should be loaded.IOException
- if something goes wrong loading the data.public void save(D data, String destination) throws IOException
TypedIOService
The saver to use is automatically determined based on available
IOPlugin
s; see TypedIOService.getSaver(Object, String)
.
save
in interface TypedIOService<D>
data
- The data to be saved to the destination.destination
- The destination (e.g., file path) to which data should
be saved.IOException
- if something goes wrong saving the data.public void save(D data, Location destination) throws IOException
TypedIOService
The saver to use is automatically determined based on available
IOPlugin
s; see TypedIOService.getSaver(Object, Location)
.
save
in interface TypedIOService<D>
data
- The data to be saved to the destination.destination
- The destination location to which data should be saved.IOException
- if something goes wrong saving the data.public boolean canOpen(String source)
canOpen
in interface TypedIOService<D>
public boolean canOpen(Location source)
canOpen
in interface TypedIOService<D>
public boolean canSave(D data, String source)
canSave
in interface TypedIOService<D>
public boolean canSave(D data, Location destination)
canSave
in interface TypedIOService<D>
protected LocationService locationService()
protected IOService ioService()
Copyright © 2015–2022 SciJava. All rights reserved.