public interface TypedIOService<D> extends HandlerService<Location,IOPlugin<D>>, SciJavaService
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 destination) |
default IOPlugin<D> |
getOpener(Location source)
Gets the most appropriate
IOPlugin for opening data from the given
location. |
default IOPlugin<D> |
getOpener(String source)
Gets the most appropriate
IOPlugin for 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,
Location destination)
Gets the most appropriate
IOPlugin for saving data to the given
location. |
default IOPlugin<D> |
getSaver(D data,
String destination)
Gets the most appropriate
IOPlugin for saving data to the given
location. |
default Class<Location> |
getType()
Gets the type associated with the object.
|
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.
|
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
default IOPlugin<D> getOpener(String source)
IOPlugin
for opening data from the given
location.default IOPlugin<D> getOpener(Location source)
IOPlugin
for opening data from the given
location.default IOPlugin<D> getSaver(D data, String destination)
IOPlugin
for saving data to the given
location.default IOPlugin<D> getSaver(D data, Location destination)
IOPlugin
for saving data to the given
location.D open(String source) throws IOException
The opener to use is automatically determined based on available
IOPlugin
s; see getOpener(String)
.
source
- The source (e.g., file path) from which to data should be
loaded.IOException
- if something goes wrong loading the data.D open(Location source) throws IOException
The opener to use is automatically determined based on available
IOPlugin
s; see getOpener(Location)
.
source
- The location from which to data should be loaded.IOException
- if something goes wrong loading the data.void save(D data, String destination) throws IOException
The saver to use is automatically determined based on available
IOPlugin
s; see getSaver(Object, String)
.
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.void save(D data, Location destination) throws IOException
The saver to use is automatically determined based on available
IOPlugin
s; see getSaver(Object, Location)
.
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.boolean canOpen(String source)
boolean canOpen(Location source)
default Class<IOPlugin<D>> getPluginType()
PTService
getPluginType
in interface PTService<IOPlugin<D>>
Copyright © 2015–2022 SciJava. All rights reserved.