public interface FormatService extends SCIFIOService
Format instances given a
child class, discovering available formats, and managing the list of
available formats.Format| Modifier and Type | Field and Description |
|---|---|
static double |
PRIORITY |
| Modifier and Type | Method and Description |
|---|---|
void |
addComponents(Format format)
Creates mappings between this Format and its components.
|
<M extends Metadata> |
addFormat(Format format)
Makes the provided
Format available for image IO operations in this
context. |
Set<Format> |
getAllFormats()
Returns a list of all Formats within this context.
|
Format |
getFormat(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source)
As
getFormat(Location) but takes an initialized
DataHandle. |
Format |
getFormat(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source,
SCIFIOConfig config)
As
getFormat(Location, SCIFIOConfig) but takes an initialized
DataHandle. |
Format |
getFormat(org.scijava.io.location.Location id)
Returns the first
Format known to be compatible with the source
provided. |
Format |
getFormat(org.scijava.io.location.Location id,
SCIFIOConfig config)
Returns the first Format known to be compatible with the source provided.
|
<C extends Checker> |
getFormatFromChecker(Class<C> checkerClass)
Format lookup method using the Checker component. |
<F extends Format> |
getFormatFromClass(Class<F> formatClass)
Lookup method for the Format map.
|
Format |
getFormatFromComponent(Class<?> componentClass)
Returns the Format compatible with this component class, or null if no
matching Format can be found.
|
<M extends Metadata> |
getFormatFromMetadata(Class<M> metadataClass)
Format lookup method using the Metadata component. |
<P extends Parser> |
getFormatFromParser(Class<P> parserClass)
Format lookup method using the Parser component. |
<R extends Reader> |
getFormatFromReader(Class<R> readerClass)
Format lookup method using the Reader component |
<W extends Writer> |
getFormatFromWriter(Class<W> writerClass)
Format lookup method using the Writer component. |
List<Format> |
getFormatList(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source)
As
getFormatList(Location) but takes an initialized
DataHandle. |
List<Format> |
getFormatList(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source,
SCIFIOConfig config,
boolean greedy)
As
getFormatList(Location, SCIFIOConfig, boolean) but takes an
initialized DataHandle. |
List<Format> |
getFormatList(org.scijava.io.location.Location id)
Returns a list of all formats that are compatible with the source provided,
ordered by their priority.
|
List<Format> |
getFormatList(org.scijava.io.location.Location id,
SCIFIOConfig config,
boolean greedy)
Returns a list of all formats that are compatible with the source provided,
ordered by their priority.
|
Collection<Format> |
getOutputFormats() |
String[] |
getSuffixes()
Returns a complete list of all suffixes supported within this context.
|
Writer |
getWriterForLocation(org.scijava.io.location.Location fileId)
Writer lookup method using the suffix or other methods to locate a
fitting writer. |
void |
removeComponents(Format format)
Removes any mappings involving this Format's components.
|
boolean |
removeFormat(Format format)
Removes the provided
Format from this context, if it was previously
available. |
initialize, registerEventHandlersgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersiondisposestatic final double PRIORITY
String[] getSuffixes()
<M extends Metadata> boolean addFormat(Format format)
Format available for image IO operations in this
context.
No effect if the format is already known.
format - a new Format to support in this context.Format was added successfully.void addComponents(Format format)
void removeComponents(Format format)
boolean removeFormat(Format format)
Format from this context, if it was previously
available.format - the Format to stop supporting in this context.<F extends Format> F getFormatFromClass(Class<F> formatClass)
Format.
NB: because SezPoz is used for automatic detection of Formats in
SCIFIO, all concrete Format implementations have a zero-parameter
constructor. If you manually invoke that constructor and then try to link
your Format to an existing context, e.g. via the
addFormat(Format) method, it will fail if the Format was
already discovered. The same principle is true if the context-based
constructor is invoked.
formatClass - the class of the desired FormatFormat, or
null if the Format was not found.Format getFormatFromComponent(Class<?> componentClass)
<R extends Reader> Format getFormatFromReader(Class<R> readerClass)
Format lookup method using the Reader componentreaderClass - the class of the Reader component for the
desired FormatFormat, or null if the
Format was not found.<W extends Writer> Format getFormatFromWriter(Class<W> writerClass)
Format lookup method using the Writer component.writerClass - the class of the Writer component for the
desired FormatFormat, or null if the
Format was not found.Writer getWriterForLocation(org.scijava.io.location.Location fileId) throws FormatException
Writer lookup method using the suffix or other methods to locate a
fitting writer.
This bypasses the Checker logic, and thus does not guarantee the
associated Format can read image sources of the provided type.FormatException - if now writer could be found<C extends Checker> Format getFormatFromChecker(Class<C> checkerClass)
Format lookup method using the Checker component.checkerClass - the class of the Checker component for the
desired FormatFormat, or null if the
Format was not found.<P extends Parser> Format getFormatFromParser(Class<P> parserClass)
Format lookup method using the Parser component.parserClass - the class of the Parser component for the
desired FormatFormat, or null if the
Format was not found.<M extends Metadata> Format getFormatFromMetadata(Class<M> metadataClass)
Format lookup method using the Metadata component.metadataClass - the class of the Metadata component for the
desired FormatFormat, or null if the
Format was not found.Format getFormat(org.scijava.io.location.Location id) throws FormatException
Format known to be compatible with the source
provided. Formats are checked in ascending order of their priority. The
source is read if necessary to determine compatibility.id - the sourceFormat compatible with the provided sourceFormatException - if no compatible format was found, or if something
goes wrong checking the sourceFormat getFormat(org.scijava.io.location.Location id, SCIFIOConfig config) throws FormatException
id - the sourceconfig - Configuration for this method execution.Format compatible with the provided sourceFormatException - if no compatible format was found, or if something
goes wrong checking the sourceList<Format> getFormatList(org.scijava.io.location.Location id) throws FormatException
id - the sourceFormats compatible with the provided source,
which will be an empty list if no compatible formats are found.FormatException - if something goes wrong checking the source.List<Format> getFormatList(org.scijava.io.location.Location id, SCIFIOConfig config, boolean greedy) throws FormatException
id - the sourceconfig - Configuration for this method execution.greedy - if true, the search will terminate after finding the first
compatible formatFormats compatible with the provided source,
which will be an empty list if no compatible formats are found.FormatException - if something goes wrong checking the source.Format getFormat(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source) throws FormatException
getFormat(Location) but takes an initialized
DataHandle.source - the sourceFormat compatible with the provided sourceFormatException - if no compatible format was found, or if something
goes wrong checking the sourceFormat getFormat(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source, SCIFIOConfig config) throws FormatException
getFormat(Location, SCIFIOConfig) but takes an initialized
DataHandle.source - the sourceconfig - Configuration for this method execution.Format compatible with the provided sourceFormatException - if no compatible format was found, or if something
goes wrong checking the sourceList<Format> getFormatList(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source) throws FormatException
getFormatList(Location) but takes an initialized
DataHandle.source - the sourceFormats compatible with the provided source,
which will be an empty list if no compatible formats are found.FormatException - if something goes wrong checking the source.List<Format> getFormatList(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source, SCIFIOConfig config, boolean greedy) throws FormatException
getFormatList(Location, SCIFIOConfig, boolean) but takes an
initialized DataHandle.source - the sourceconfig - Configuration for this method execution.greedy - if true, the search will terminate after finding the first
compatible formatFormats compatible with the provided source,
which will be an empty list if no compatible formats are found.FormatException - if something goes wrong checking the source.Collection<Format> getOutputFormats()
Writer implementations.Copyright © 2011–2026 SCIFIO. All rights reserved.