org.geotoolkit.image.io
Class TextImageWriter.Spi

Object
  extended by IIOServiceProvider
      extended by ImageReaderWriterSpi
          extended by ImageWriterSpi
              extended by SpatialImageWriter.Spi
                  extended by StreamImageWriter.Spi
                      extended by TextImageWriter.Spi
All Implemented Interfaces:
RegisterableService
Direct Known Subclasses:
AsciiGridWriter.Spi, TextMatrixImageWriter.Spi
Enclosing class:
TextImageWriter

protected abstract static class TextImageWriter.Spi
extends StreamImageWriter.Spi

Service provider interface (SPI) for TextImageWriter. This SPI provides additional fields controling the character encoding (charset), the local to use for formating numbers, dates or other objects (locale) and the line separator (lineSeparator).

By default the charset, locale and lineSeparator fields are initialized to null, which stands for the platform-dependent defaults. If a subclass wants to fix the encoding and locale to some format-specific values, it shall specify those values at construction time as in the example below:

public Spi() {
    charset = Charset.forName("ISO-8859-1"); // ISO Latin Alphabet No. 1
    locale  = Locale.US;
}
The table below summarizes the initial values. Those values can be modified by subclass constructors.

Field Value
 ImageWriterSpi.outputTypes   String, File, URI, URL, URLConnection, Writer, OutputStream, ImageOutputStream, WritableByteChannel 
 ImageReaderWriterSpi.suffixes   "txt", "TXT", "asc", "ASC", "dat", "DAT" 
 charset   null (stands for the platform default
 locale   null (stands for the platform default
 lineSeparator   null (stands for the platform default) 
See super-class javadoc for remaining fields

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

Field Summary
protected  Charset charset
          Character encoding, or null for the default.
protected  String lineSeparator
          The line separator to use, or null for the system default.
protected  Locale locale
          The locale for numbers formatting.
 
Fields inherited from class ImageWriterSpi
outputTypes, readerSpiNames, STANDARD_OUTPUT_TYPE
 
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
protected TextImageWriter.Spi()
          Constructs a quasi-blank TextImageWriter.Spi.
 
Method Summary
 
Methods inherited from class StreamImageWriter.Spi
canEncodeImage
 
Methods inherited from class SpatialImageWriter.Spi
getImageMetadataFormat, getStreamMetadataFormat
 
Methods inherited from class ImageWriterSpi
canEncodeImage, createWriterInstance, createWriterInstance, getImageReaderSpiNames, getOutputTypes, isFormatLossless, isOwnWriter
 
Methods inherited from class ImageReaderWriterSpi
getExtraImageMetadataFormatNames, getExtraStreamMetadataFormatNames, getFileSuffixes, getFormatNames, getMIMETypes, getNativeImageMetadataFormatName, getNativeStreamMetadataFormatName, getPluginClassName, isStandardImageMetadataFormatSupported, isStandardStreamMetadataFormatSupported
 
Methods inherited from class IIOServiceProvider
getDescription, getVendorName, getVersion, onDeregistration, onRegistration
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

charset

protected Charset charset
Character encoding, or null for the default. This field is initially null. A value shall be set by subclasses if the files to be encoded use some specific character encoding.

See Also:
TextImageWriter.getCharset(ImageWriteParam)

locale

protected Locale locale
The locale for numbers formatting. For example Locale.US means that numbers are expected to use dot as decimal separator. This field is initially null, which means that default locale should be used.

See Also:
TextImageWriter.getDataLocale(ImageWriteParam)

lineSeparator

protected String lineSeparator
The line separator to use, or null for the system default.

See Also:
TextImageWriter.getLineSeparator(ImageWriteParam)
Constructor Detail

TextImageWriter.Spi

protected TextImageWriter.Spi()
Constructs a quasi-blank TextImageWriter.Spi. This constructor initializes the fields as documented in the class javadoc. It is up to the subclass to initialize all other instance variables in order to provide working versions of all methods.

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



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