public final class DefaultIOService extends AbstractHandlerService<String,IOPlugin<?>> implements IOService
IOService
.Constructor and Description |
---|
DefaultIOService() |
Modifier and Type | Method and Description |
---|---|
IOPlugin<?> |
getOpener(String source)
Gets the most appropriate
IOPlugin for opening data from the given
source. |
Class<IOPlugin<?>> |
getPluginType()
Gets the type of plugins managed by this service.
|
<D> IOPlugin<D> |
getSaver(D data,
String destination)
Gets the most appropriate
IOPlugin for saving data to the given
destination. |
Class<String> |
getType()
Gets the type associated with the object.
|
Object |
open(String source)
Loads data from the given source.
|
void |
save(Object data,
String destination)
Saves data to the given destination.
|
getHandler, supports
create, filterInstances, getInstance, getInstances, initialize
getPlugins, getPluginService
dispose, getContext, registerEventHandlers, setContext, toString
compareTo, getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getHandler, getInstances, supports
getInstance
create, getPlugins, getPluginService
initialize, registerEventHandlers
context, getContext, setContext
getPriority, setPriority
compareTo
getInfo, setInfo
dispose
public IOPlugin<?> getOpener(String source)
IOService
IOPlugin
for opening data from the given
source.public <D> IOPlugin<D> getSaver(D data, String destination)
IOService
IOPlugin
for saving data to the given
destination.public Object open(String source) throws IOException
IOService
The opener to use is automatically determined based on available
IOPlugin
s; see IOService.getOpener(String)
.
open
in interface IOService
source
- The source (e.g., file path) from which to data should be
loaded.IOException
- if something goes wrong loading the data.public void save(Object data, String destination) throws IOException
IOService
The saver to use is automatically determined based on available
IOPlugin
s; see IOService.getSaver(Object, String)
.
save
in interface IOService
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 Class<IOPlugin<?>> getPluginType()
PTService
getPluginType
in interface PTService<IOPlugin<?>>
Copyright © 2009–2016 SciJava. All rights reserved.