org.scijava.io
Interface IOPlugin<D>

All Superinterfaces:
Comparable<Prioritized>, Contextual, HandlerPlugin<String>, HasPluginInfo, Prioritized, RichPlugin, SciJavaPlugin, SingletonPlugin, Typed<String>, TypedPlugin<String>
All Known Implementing Classes:
AbstractIOPlugin, ScriptIOPlugin, TextIOPlugin

public interface IOPlugin<D>
extends HandlerPlugin<String>

A plugin which extends an application's I/O capabilities.

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.

Author:
Curtis Rueden
See Also:
Plugin, IOService

Method Summary
 Class<D> getDataType()
          The type of data opened and/or saved by the plugin.
 D open(String source)
          Opens data from the given source.
 void save(D data, String destination)
          Saves the given data to the specified destination.
 boolean supportsOpen(String source)
          Checks whether the I/O plugin can open data from the given source.
 boolean supportsSave(Object data, String destination)
          Checks whether the I/O plugin can save the given data to the specified destination.
 boolean supportsSave(String destination)
          Checks whether the I/O plugin can save data to the given destination.
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 
Methods inherited from interface org.scijava.Typed
getType, supports
 

Method Detail

getDataType

Class<D> getDataType()
The type of data opened and/or saved by the plugin.


supportsOpen

boolean supportsOpen(String source)
Checks whether the I/O plugin can open data from the given source.


supportsSave

boolean supportsSave(String destination)
Checks whether the I/O plugin can save data to the given destination.


supportsSave

boolean supportsSave(Object data,
                     String destination)
Checks whether the I/O plugin can save the given data to the specified destination.


open

D open(String source)
       throws IOException
Opens data from the given source.

Throws:
IOException

save

void save(D data,
          String destination)
          throws IOException
Saves the given data to the specified destination.

Throws:
IOException


Copyright © 2009–2014 SciJava. All rights reserved.