org.geotoolkit.image.io.plugin
Class TextMatrixImageReader.Spi

Object
  extended by IIOServiceProvider
      extended by ImageReaderWriterSpi
          extended by ImageReaderSpi
              extended by SpatialImageReader.Spi
                  extended by StreamImageReader.Spi
                      extended by TextImageReader.Spi
                          extended by TextMatrixImageReader.Spi
All Implemented Interfaces:
RegisterableService
Enclosing class:
TextMatrixImageReader

public static class TextMatrixImageReader.Spi
extends TextImageReader.Spi

Service provider interface (SPI) for TextMatrixImageReaders. This SPI provides the necessary implementation for creating default TextMatrixImageReader using default locale and character set. The default constructor initializes the fields to the values listed below:

FieldValue
 ImageReaderWriterSpi.names   "matrix" 
 ImageReaderWriterSpi.MIMETypes   "text/plain", "text/x-matrix" 
 ImageReaderWriterSpi.pluginClassName   "org.geotoolkit.image.io.plugin.TextMatrixImageReader" 
 IIOServiceProvider.vendorName   "Geotoolkit.org" 
 IIOServiceProvider.version   Version.GEOTOOLKIT 
See super-class javadoc for remaining fields

Subclasses can set some fields at construction time in order to tune the reader to a particular environment, e.g.:

public final class MyCustomSpi extends TextMatrixImageReader.Spi {
    public MyCustomSpi() {
        names      = new String[] {"myformat"};
        MIMETypes  = new String[] {"text/plain"};
        vendorName = "Foo inc.";
        version    = "1.0";
        locale     = Locale.US;
        charset    = Charset.forName("ISO-8859-1"); // ISO-LATIN-1
        padValue   = -9999;
    }
}
Note: fields vendorName and version are only informatives.
There is no need to override any method in this example. However, developers can gain more control by creating subclasses of TextMatrixImageReader and Spi.

Since:
3.08 (derived from 2.1)
Version:
3.08
Author:
Martin Desruisseaux (IRD)
See Also:
TextMatrixImageWriter.Spi
Module:
coverage/geotk-coverageio (download)    View source code for this class

Field Summary
 
Fields inherited from class TextImageReader.Spi
charset, locale, padValue
 
Fields inherited from class ImageReaderSpi
inputTypes, STANDARD_INPUT_TYPE, writerSpiNames
 
Fields inherited from class ImageReaderWriterSpi
extraImageMetadataFormatClassNames, extraImageMetadataFormatNames, extraStreamMetadataFormatClassNames, extraStreamMetadataFormatNames, MIMETypes, names, nativeImageMetadataFormatClassName, nativeImageMetadataFormatName, nativeStreamMetadataFormatClassName, nativeStreamMetadataFormatName, pluginClassName, suffixes, supportsStandardImageMetadataFormat, supportsStandardStreamMetadataFormat
 
Fields inherited from class IIOServiceProvider
vendorName, version
 
Constructor Summary
TextMatrixImageReader.Spi()
          Constructs a default TextMatrixImageReader.Spi.
 
Method Summary
 ImageReader createReaderInstance(Object extension)
          Returns an instance of the ImageReader implementation associated with this service provider.
 String getDescription(Locale locale)
          Returns a brief, human-readable description of this service provider and its associated implementation.
 
Methods inherited from class TextImageReader.Spi
canDecodeInput, canDecodeInput, isValidColumnCount, isValidContent, isValidHeader
 
Methods inherited from class SpatialImageReader.Spi
getImageMetadataFormat, getStreamMetadataFormat
 
Methods inherited from class ImageReaderSpi
createReaderInstance, getImageWriterSpiNames, getInputTypes, isOwnReader
 
Methods inherited from class ImageReaderWriterSpi
getExtraImageMetadataFormatNames, getExtraStreamMetadataFormatNames, getFileSuffixes, getFormatNames, getMIMETypes, getNativeImageMetadataFormatName, getNativeStreamMetadataFormatName, getPluginClassName, isStandardImageMetadataFormatSupported, isStandardStreamMetadataFormatSupported
 
Methods inherited from class IIOServiceProvider
getVendorName, getVersion, onDeregistration, onRegistration
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextMatrixImageReader.Spi

public TextMatrixImageReader.Spi()
Constructs a default TextMatrixImageReader.Spi. The fields are initialized as documented in the class javadoc. Subclasses can modify those values if desired.

For efficiency reasons, the above fields are initialized to shared arrays. Subclasses can assign new arrays, but should not modify the default array content.

Method Detail

getDescription

public String getDescription(Locale locale)
Returns a brief, human-readable description of this service provider and its associated implementation. The resulting string should be localized for the supplied locale, if possible.

Specified by:
getDescription in class IIOServiceProvider
Parameters:
locale - A Locale for which the return value should be localized.
Returns:
A String containing a description of this service provider.

createReaderInstance

public ImageReader createReaderInstance(Object extension)
                                 throws IOException
Returns an instance of the ImageReader implementation associated with this service provider.

Specified by:
createReaderInstance in class ImageReaderSpi
Parameters:
extension - An optional extension object, which may be null.
Returns:
An image reader instance.
Throws:
IOException - if the attempt to instantiate the reader fails.


Copyright © 2009-2012 Geotoolkit.org. All Rights Reserved.