public interface IOPlugin<D> extends HandlerPlugin<Location>
I/O plugins discoverable at runtime must implement this interface and be
annotated with @Plugin
with attribute Plugin.type()
=
IOPlugin
.class. While it possible to create an I/O plugin merely by
implementing this interface, it is encouraged to instead extend
AbstractIOPlugin
, for convenience.
Modifier and Type | Method and Description |
---|---|
Class<D> |
getDataType()
The type of data opened and/or saved by the plugin.
|
default Class<Location> |
getType()
Gets the type associated with the object.
|
default D |
open(Location source)
Opens data from the given location.
|
default D |
open(String source)
Opens data from the given source.
|
default void |
save(D data,
Location destination)
Saves the given data to the specified location.
|
default void |
save(D data,
String destination)
Saves the given data to the specified destination.
|
default boolean |
supports(String descriptor) |
default boolean |
supportsOpen(Location source)
Checks whether the I/O plugin can open data from the given location.
|
default boolean |
supportsOpen(String source)
Checks whether the I/O plugin can open data from the given source.
|
default boolean |
supportsSave(Location destination)
Checks whether the I/O plugin can save data to the given location.
|
default boolean |
supportsSave(Object data,
Location destination) |
default boolean |
supportsSave(Object data,
String destination)
Checks whether the I/O plugin can save the given data to the specified
location.
|
default boolean |
supportsSave(String destination)
Checks whether the I/O plugin can save data to the given destination.
|
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
default boolean supportsOpen(String source)
default boolean supportsOpen(Location source)
default boolean supportsSave(String destination)
default boolean supportsSave(Location destination)
default boolean supportsSave(Object data, String destination)
default D open(String source) throws IOException
IOException
default D open(Location source) throws IOException
IOException
default void save(D data, String destination) throws IOException
IOException
default void save(D data, Location destination) throws IOException
IOException
default boolean supports(String descriptor)
Copyright © 2015–2022 SciJava. All rights reserved.