public class DefaultFormatService extends org.scijava.service.AbstractService implements FormatService
FormatService implementationFormatServicePRIORITY| Constructor and Description |
|---|
DefaultFormatService() |
| Modifier and Type | Method and Description |
|---|---|
void |
addComponents(Format format)
Creates mappings between this Format and its components.
|
boolean |
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
FormatService.getFormat(Location) but takes an initialized
DataHandle. |
Format |
getFormat(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source,
SCIFIOConfig config)
As
FormatService.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
FormatService.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
FormatService.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.
|
String |
getVersion() |
Writer |
getWriterForLocation(org.scijava.io.location.Location fileId)
Writer lookup method using the suffix or other methods to locate a
fitting writer. |
void |
initialize() |
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. |
getContext, setContext, toStringgetInfo, getPriority, setInfo, setPrioritycontextclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitregisterEventHandlersgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationdisposepublic String[] getSuffixes()
FormatServicegetSuffixes in interface FormatServicepublic boolean addFormat(Format format)
FormatServiceFormat available for image IO operations in this
context.
No effect if the format is already known.
addFormat in interface FormatServiceformat - a new Format to support in this context.Format was added successfully.public boolean removeFormat(Format format)
FormatServiceFormat from this context, if it was previously
available.removeFormat in interface FormatServiceformat - the Format to stop supporting in this context.public void addComponents(Format format)
FormatServiceaddComponents in interface FormatServicepublic void removeComponents(Format format)
FormatServiceremoveComponents in interface FormatServicepublic <F extends Format> F getFormatFromClass(Class<F> formatClass)
FormatServiceFormat.
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
FormatService.addFormat(Format) method, it will fail if the Format was
already discovered. The same principle is true if the context-based
constructor is invoked.
getFormatFromClass in interface FormatServiceformatClass - the class of the desired FormatFormat, or
null if the Format was not found.public Format getFormatFromComponent(Class<?> componentClass)
FormatServicegetFormatFromComponent in interface FormatServicepublic <R extends Reader> Format getFormatFromReader(Class<R> readerClass)
FormatServiceFormat lookup method using the Reader componentgetFormatFromReader in interface FormatServicereaderClass - the class of the Reader component for the
desired FormatFormat, or null if the
Format was not found.public <W extends Writer> Format getFormatFromWriter(Class<W> writerClass)
FormatServiceFormat lookup method using the Writer component.getFormatFromWriter in interface FormatServicewriterClass - the class of the Writer component for the
desired FormatFormat, or null if the
Format was not found.public Writer getWriterForLocation(org.scijava.io.location.Location fileId) throws FormatException
FormatServiceWriter 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.getWriterForLocation in interface FormatServiceFormatException - if now writer could be foundpublic <C extends Checker> Format getFormatFromChecker(Class<C> checkerClass)
FormatServiceFormat lookup method using the Checker component.getFormatFromChecker in interface FormatServicecheckerClass - the class of the Checker component for the
desired FormatFormat, or null if the
Format was not found.public <P extends Parser> Format getFormatFromParser(Class<P> parserClass)
FormatServiceFormat lookup method using the Parser component.getFormatFromParser in interface FormatServiceparserClass - the class of the Parser component for the
desired FormatFormat, or null if the
Format was not found.public <M extends Metadata> Format getFormatFromMetadata(Class<M> metadataClass)
FormatServiceFormat lookup method using the Metadata component.getFormatFromMetadata in interface FormatServicemetadataClass - the class of the Metadata component for the
desired FormatFormat, or null if the
Format was not found.public Format getFormat(org.scijava.io.location.Location id) throws FormatException
FormatServiceFormat 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.getFormat in interface FormatServiceid - the sourceFormat compatible with the provided sourceFormatException - if no compatible format was found, or if something
goes wrong checking the sourcepublic Format getFormat(org.scijava.io.location.Location id, SCIFIOConfig config) throws FormatException
FormatServicegetFormat in interface FormatServiceid - 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 sourcepublic List<Format> getFormatList(org.scijava.io.location.Location id) throws FormatException
FormatServicegetFormatList in interface FormatServiceid - 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.public List<Format> getFormatList(org.scijava.io.location.Location id, SCIFIOConfig config, boolean greedy) throws FormatException
FormatServicegetFormatList in interface FormatServiceid - 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.public Format getFormat(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source) throws FormatException
FormatServiceFormatService.getFormat(Location) but takes an initialized
DataHandle.getFormat in interface FormatServicesource - the sourceFormat compatible with the provided sourceFormatException - if no compatible format was found, or if something
goes wrong checking the sourcepublic Format getFormat(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source, SCIFIOConfig config) throws FormatException
FormatServiceFormatService.getFormat(Location, SCIFIOConfig) but takes an initialized
DataHandle.getFormat in interface FormatServicesource - 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 sourcepublic List<Format> getFormatList(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source) throws FormatException
FormatServiceFormatService.getFormatList(Location) but takes an initialized
DataHandle.getFormatList in interface FormatServicesource - 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.public List<Format> getFormatList(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> source, SCIFIOConfig config, boolean greedy) throws FormatException
FormatServiceFormatService.getFormatList(Location, SCIFIOConfig, boolean) but takes an
initialized DataHandle.getFormatList in interface FormatServicesource - 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.public Set<Format> getAllFormats()
FormatServicegetAllFormats in interface FormatServicepublic Collection<Format> getOutputFormats()
getOutputFormats in interface FormatServiceWriter implementations.public String getVersion()
getVersion in interface org.scijava.Versionedpublic void initialize()
initialize in interface org.scijava.Initializableinitialize in interface org.scijava.service.ServiceCopyright © 2011–2026 SCIFIO. All rights reserved.