org.scijava.io
Class AbstractIOPlugin<D>

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.plugin.AbstractRichPlugin
          extended by org.scijava.plugin.AbstractTypedPlugin<D>
              extended by org.scijava.plugin.AbstractHandlerPlugin<String>
                  extended by org.scijava.io.AbstractIOPlugin<D>
All Implemented Interfaces:
Comparable<Prioritized>, Contextual, IOPlugin<D>, HandlerPlugin<String>, HasPluginInfo, RichPlugin, SciJavaPlugin, SingletonPlugin, TypedPlugin<String>, Prioritized, Typed<String>
Direct Known Subclasses:
ScriptIOPlugin, TextIOPlugin

public abstract class AbstractIOPlugin<D>
extends AbstractHandlerPlugin<String>
implements IOPlugin<D>

Abstract base class for IOPlugins.

Author:
Curtis Rueden

Constructor Summary
AbstractIOPlugin()
           
 
Method Summary
 Class<String> getType()
          Gets the type associated with the object.
 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 supports(String descriptor)
          Gets whether this object is compatible with the given data object.
 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 class org.scijava.plugin.AbstractRichPlugin
compareTo, getInfo, getPriority, setInfo, setPriority, toString
 
Methods inherited from class org.scijava.AbstractContextual
context, getContext, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.scijava.io.IOPlugin
getDataType
 
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
 

Constructor Detail

AbstractIOPlugin

public AbstractIOPlugin()
Method Detail

supportsOpen

public boolean supportsOpen(String source)
Description copied from interface: IOPlugin
Checks whether the I/O plugin can open data from the given source.

Specified by:
supportsOpen in interface IOPlugin<D>

supportsSave

public boolean supportsSave(String destination)
Description copied from interface: IOPlugin
Checks whether the I/O plugin can save data to the given destination.

Specified by:
supportsSave in interface IOPlugin<D>

supportsSave

public boolean supportsSave(Object data,
                            String destination)
Description copied from interface: IOPlugin
Checks whether the I/O plugin can save the given data to the specified destination.

Specified by:
supportsSave in interface IOPlugin<D>

open

public D open(String source)
       throws IOException
Description copied from interface: IOPlugin
Opens data from the given source.

Specified by:
open in interface IOPlugin<D>
Throws:
IOException

save

public void save(D data,
                 String destination)
          throws IOException
Description copied from interface: IOPlugin
Saves the given data to the specified destination.

Specified by:
save in interface IOPlugin<D>
Throws:
IOException

supports

public boolean supports(String descriptor)
Description copied from interface: Typed
Gets whether this object is compatible with the given data object.

Typically, this will be the case when data.getClass() is assignable to the type associated with the object (i.e., the one returned by Typed.getType()). But individual implementations may have other requirements beyond class assignability.

Specified by:
supports in interface Typed<String>
Overrides:
supports in class AbstractTypedPlugin<String>

getType

public Class<String> getType()
Description copied from interface: Typed
Gets the type associated with the object.

Specified by:
getType in interface Typed<String>


Copyright © 2009–2014 SciJava. All rights reserved.