javax.imageio.spi

Class ImageReaderWriterSpi

public abstract class ImageReaderWriterSpi extends IIOServiceProvider

An abstract superclass that contains the common parts of {@link javax.imageio.spi.ImageReaderSpi} and {@link javax.imageio.spi.ImageWriterSpi}.

Since: 1.4

Field Summary
protected String[]extraImageMetadataFormatClassNames
protected String[]extraImageMetadataFormatNames
The names of additional formats for encoding image metadata, other than the {@linkplain #isStandardImageMetadataFormatSupported() standard} and the {@linkplain #getNativeImageMetadataFormatName() native} formats, or null if this plug-in does not provide any extra formats.
protected String[]extraStreamMetadataFormatClassNames
protected String[]extraStreamMetadataFormatNames
The names of additional formats for encoding stream metadata, other than the {@linkplain #isStandardStreamMetadataFormatSupported() standard} and the {@linkplain #getNativeStreamMetadataFormatName() native} formats, or null if this plug-in does not provide any extra formats.
protected String[]MIMETypes
The MIME types of the supported image formats.
protected String[]names
The human-readable, localized names of the supported image formats.
protected StringnativeImageMetadataFormatClassName
protected StringnativeImageMetadataFormatName
The name of the format that allows encoding all image metadata without loss, or null if this plug-in does not provide a format that preserves all image metadata.
protected StringnativeStreamMetadataFormatClassName
protected StringnativeStreamMetadataFormatName
The name of the format that allows encoding all stream metadata without loss, or null if this plug-in does not provide a format that preserves all stream metadata.
protected StringpluginClassName
The fully qualified name of the class that implements the {@link javax.imageio.ImageReader} or {@link javax.imageio.ImageWriter} interface.
protected String[]suffixes
The file suffixes of the supported image formats.
protected booleansupportsStandardImageMetadataFormat
Indicates whether the per-image {@linkplain javax.imageio.metadata.IIOMetadata metadata objects} associated with this plug-in support format “javax_imageio_1.0” in their getAsTree and setAsTree methods.
protected booleansupportsStandardStreamMetadataFormat
Indicates whether the per-stream {@linkplain javax.imageio.metadata.IIOMetadata metadata objects} associated with this plug-in support format “javax_imageio_1.0” in their getAsTree and setAsTree methods.
Constructor Summary
ImageReaderWriterSpi()
Constructs an ImageReaderWriteSpi instance, without specifying a number of parameters.
ImageReaderWriterSpi(String vendorName, String version, String[] names, String[] suffixes, String[] MIMETypes, String pluginClassName, boolean supportsStandardStreamMetadataFormat, String nativeStreamMetadataFormatName, String nativeStreamMetadataFormatClassName, String[] extraStreamMetadataFormatNames, String[] extraStreamMetadataFormatClassNames, boolean supportsStandardImageMetadataFormat, String nativeImageMetadataFormatName, String nativeImageMetadataFormatClassName, String[] extraImageMetadataFormatNames, String[] extraImageMetadataFormatClassNames)
Constructs an ImageReaderWriteSpi instance, specifying a number of parameters.
Method Summary
String[]getExtraImageMetadataFormatNames()
Returns the names of additional formats for encoding image metadata, other than the {@linkplain #isStandardImageMetadataFormatSupported() standard} and the {@linkplain #getNativeImageMetadataFormatName() native} formats, or null if this plug-in does not provide any extra formats.
String[]getExtraStreamMetadataFormatNames()
Returns the names of additional formats for encoding stream metadata, other than the {@linkplain #isStandardStreamMetadataFormatSupported() standard} and the {@linkplain #getNativeStreamMetadataFormatName() native} formats, or null if this plug-in does not provide any extra formats.
String[]getFileSuffixes()
Returns the file suffixes of the supported image formats, for example [“tiff”, “tif”, “png”].
String[]getFormatNames()
Returns the human-readable, localized names of the supported image formats.
IIOMetadataFormatgetImageMetadataFormat(String formatName)
Returns an IIOMetadataFormat object that represents the requested image metadata format or null if the given format is supported but no IIOMetadataFormat can be created for it.
String[]getMIMETypes()
Returns the MIME types of the supported image formats, for example [“image/tiff”, “image/png”].
StringgetNativeImageMetadataFormatName()
Returns the name of the format that allows encoding all image metadata without loss, or null if this plug-in does not provide a format that preserves all image metadata.
StringgetNativeStreamMetadataFormatName()
Returns the name of the format that allows encoding all stream metadata without loss, or null if this plug-in does not provide a format that preserves all stream metadata.
StringgetPluginClassName()
Returns the fully qualified name of the class that implements the {@link javax.imageio.ImageReader} or {@link javax.imageio.ImageWriter} interface.
IIOMetadataFormatgetStreamMetadataFormat(String formatName)
Returns an IIOMetadataFormat object that represents the requested stream metadata format or null if the given format is supported but no IIOMetadataFormat can be created for it.
booleanisStandardImageMetadataFormatSupported()
Returns whether the per-image {@linkplain javax.imageio.metadata.IIOMetadata metadata objects} associated with this plug-in support format “javax_imageio_1.0” in their getAsTree and setAsTree methods.
booleanisStandardStreamMetadataFormatSupported()
Returns whether the per-stream {@linkplain javax.imageio.metadata.IIOMetadata metadata objects} associated with this plug-in support format “javax_imageio_1.0” in their getAsTree and setAsTree methods.

Field Detail

extraImageMetadataFormatClassNames

protected String[] extraImageMetadataFormatClassNames

extraImageMetadataFormatNames

protected String[] extraImageMetadataFormatNames
The names of additional formats for encoding image metadata, other than the {@linkplain #isStandardImageMetadataFormatSupported() standard} and the {@linkplain #getNativeImageMetadataFormatName() native} formats, or null if this plug-in does not provide any extra formats.

extraStreamMetadataFormatClassNames

protected String[] extraStreamMetadataFormatClassNames

extraStreamMetadataFormatNames

protected String[] extraStreamMetadataFormatNames
The names of additional formats for encoding stream metadata, other than the {@linkplain #isStandardStreamMetadataFormatSupported() standard} and the {@linkplain #getNativeStreamMetadataFormatName() native} formats, or null if this plug-in does not provide any extra formats.

MIMETypes

protected String[] MIMETypes
The MIME types of the supported image formats. This value should be non-null after construction.

See Also: getMIMETypes

names

protected String[] names
The human-readable, localized names of the supported image formats. This value should be non-null after construction.

See Also: getFormatNames

nativeImageMetadataFormatClassName

protected String nativeImageMetadataFormatClassName

nativeImageMetadataFormatName

protected String nativeImageMetadataFormatName
The name of the format that allows encoding all image metadata without loss, or null if this plug-in does not provide a format that preserves all image metadata.

nativeStreamMetadataFormatClassName

protected String nativeStreamMetadataFormatClassName

nativeStreamMetadataFormatName

protected String nativeStreamMetadataFormatName
The name of the format that allows encoding all stream metadata without loss, or null if this plug-in does not provide a format that preserves all stream metadata.

pluginClassName

protected String pluginClassName
The fully qualified name of the class that implements the {@link javax.imageio.ImageReader} or {@link javax.imageio.ImageWriter} interface. This value should be non-null after construction.

See Also: getPluginClassName

suffixes

protected String[] suffixes
The file suffixes of the supported image formats. This value should be non-null after construction.

See Also: getFileSuffixes

supportsStandardImageMetadataFormat

protected boolean supportsStandardImageMetadataFormat
Indicates whether the per-image {@linkplain javax.imageio.metadata.IIOMetadata metadata objects} associated with this plug-in support format “javax_imageio_1.0” in their getAsTree and setAsTree methods.

See Also: isStandardImageMetadataFormatSupported

supportsStandardStreamMetadataFormat

protected boolean supportsStandardStreamMetadataFormat
Indicates whether the per-stream {@linkplain javax.imageio.metadata.IIOMetadata metadata objects} associated with this plug-in support format “javax_imageio_1.0” in their getAsTree and setAsTree methods.

See Also: isStandardStreamMetadataFormatSupported

Constructor Detail

ImageReaderWriterSpi

public ImageReaderWriterSpi()
Constructs an ImageReaderWriteSpi instance, without specifying a number of parameters. Constructors of concrete subclasses must ensure that they set all inherited fields to meaningful values.

ImageReaderWriterSpi

public ImageReaderWriterSpi(String vendorName, String version, String[] names, String[] suffixes, String[] MIMETypes, String pluginClassName, boolean supportsStandardStreamMetadataFormat, String nativeStreamMetadataFormatName, String nativeStreamMetadataFormatClassName, String[] extraStreamMetadataFormatNames, String[] extraStreamMetadataFormatClassNames, boolean supportsStandardImageMetadataFormat, String nativeImageMetadataFormatName, String nativeImageMetadataFormatClassName, String[] extraImageMetadataFormatNames, String[] extraImageMetadataFormatClassNames)
Constructs an ImageReaderWriteSpi instance, specifying a number of parameters.

Parameters: names the human-readable, localized names of the supported image formats, for example [“Tagged Image File Format”, “Portable Network Graphics”]. suffixes the file suffixes of the supported image formats, for example [“tiff”, “tif”, “png”]. MIMETypes the MIME types of the supported image formats, for example [“image/tiff”, “image/png”]. pluginClassName the fully qualified name of the class that implements the {@link javax.imageio.ImageReader} or {@link javax.imageio.ImageWriter} interface. supportsStandardStreamMetadataFormat whether the per-stream {@linkplain javax.imageio.metadata.IIOMetadata metadata objects} associated with this plug-in support format “javax_imageio_1.0” in their getAsTree and setAsTree methods. nativeStreamMetadataFormatName the name of the format that allows encoding all stream metadata without loss, or null if this plug-in does not provide a format that preserves all stream metadata. extraStreamMetadataFormatNames the names of additional formats for encoding stream metadata, other than the {@linkplain #isStandardStreamMetadataFormatSupported() standard} and the {@linkplain #getNativeStreamMetadataFormatName() native} formats, or null if this plug-in does not provide any extra formats. supportsStandardImageMetadataFormat whether the per-image {@linkplain javax.imageio.metadata.IIOMetadata metadata objects} associated with this plug-in support format “javax_imageio_1.0” in their getAsTree and setAsTree methods. nativeImageMetadataFormatName the name of the format that allows encoding all image metadata without loss, or null if this plug-in does not provide a format that preserves all image metadata. extraImageMetadataFormatNames the names of additional formats for encoding image metadata, other than the {@linkplain #isStandardImageMetadataFormatSupported() standard} and the {@linkplain #getNativeImageMetadataFormatName() native} formats, or null if this plug-in does not provide any extra formats.

Throws: IllegalArgumentException if vendorName or version is null.

Method Detail

getExtraImageMetadataFormatNames

public String[] getExtraImageMetadataFormatNames()
Returns the names of additional formats for encoding image metadata, other than the {@linkplain #isStandardImageMetadataFormatSupported() standard} and the {@linkplain #getNativeImageMetadataFormatName() native} formats, or null if this plug-in does not provide any extra formats.

See Also: getExtraStreamMetadataFormatNames

getExtraStreamMetadataFormatNames

public String[] getExtraStreamMetadataFormatNames()
Returns the names of additional formats for encoding stream metadata, other than the {@linkplain #isStandardStreamMetadataFormatSupported() standard} and the {@linkplain #getNativeStreamMetadataFormatName() native} formats, or null if this plug-in does not provide any extra formats.

See Also: getExtraImageMetadataFormatNames

getFileSuffixes

public String[] getFileSuffixes()
Returns the file suffixes of the supported image formats, for example [“tiff”, “tif”, “png”].

getFormatNames

public String[] getFormatNames()
Returns the human-readable, localized names of the supported image formats. For example, a plug-in might return an array with the elements [“Tagged Image File Format”, “Portable Network Graphics”].

getImageMetadataFormat

public IIOMetadataFormat getImageMetadataFormat(String formatName)
Returns an IIOMetadataFormat object that represents the requested image metadata format or null if the given format is supported but no IIOMetadataFormat can be created for it.

Parameters: formatName the requested image metadata format name

Returns: an IIOMetadataFormat object or null

Throws: IllegalArgumentException if formatName is null or is not one of the standard metadata format or this provider's native or extra image metadata formats

getMIMETypes

public String[] getMIMETypes()
Returns the MIME types of the supported image formats, for example [“image/tiff”, “image/png”].

Returns: an array of MIME type strings, or null if none of the supported formats has an associated MIME type.

getNativeImageMetadataFormatName

public String getNativeImageMetadataFormatName()
Returns the name of the format that allows encoding all image metadata without loss, or null if this plug-in does not provide a format that preserves all image metadata.

See Also: getNativeStreamMetadataFormatName

getNativeStreamMetadataFormatName

public String getNativeStreamMetadataFormatName()
Returns the name of the format that allows encoding all stream metadata without loss, or null if this plug-in does not provide a format that preserves all stream metadata.

See Also: getNativeImageMetadataFormatName

getPluginClassName

public String getPluginClassName()
Returns the fully qualified name of the class that implements the {@link javax.imageio.ImageReader} or {@link javax.imageio.ImageWriter} interface.

getStreamMetadataFormat

public IIOMetadataFormat getStreamMetadataFormat(String formatName)
Returns an IIOMetadataFormat object that represents the requested stream metadata format or null if the given format is supported but no IIOMetadataFormat can be created for it.

Parameters: formatName the requested stream metadata format name

Returns: an IIOMetadataFormat object or null

Throws: IllegalArgumentException if formatName is null or is not one of the standard metadata format or this provider's native or extra stream metadata formats

isStandardImageMetadataFormatSupported

public boolean isStandardImageMetadataFormatSupported()
Returns whether the per-image {@linkplain javax.imageio.metadata.IIOMetadata metadata objects} associated with this plug-in support format “javax_imageio_1.0” in their getAsTree and setAsTree methods.

isStandardStreamMetadataFormatSupported

public boolean isStandardStreamMetadataFormatSupported()
Returns whether the per-stream {@linkplain javax.imageio.metadata.IIOMetadata metadata objects} associated with this plug-in support format “javax_imageio_1.0” in their getAsTree and setAsTree methods.