-
Enhancement
-
Resolution: Fixed
-
P2
-
1.4.0
-
None
-
beta
-
generic
-
solaris_7
Currently, plug-ins must provide implementations of the methods:
IIOMetadata.getMetadataFormat
ImageReaderWriterSpi.getStreamMetadataFormat
ImageReaderWriterSpi.getImageMetadataFormat
This requires each plug-in writer to be responsible for maintaining tedious and
redundant code, which is likely to lead to bugs.
A better solution is to require each metadata format to be described by
a different implementation class, and to require a 'public static getInstance'
method on each implementation, in the manner of the 'singleton' pattern.
Then, by providing the class names of the implementation classes to the
spi and metadata objects, a library implementation may use reflection to
do the work.
To implement this approach, additional arguments specifying whether the
plug-in supports the standard metadata format for stream and/or image metadata,
and the names of any IIOMetadataFormat implementation classes in addition
to those describing the native and standard formats must be supplied to the
constructors of ImageReaderWriterSpi, ImageReaderSpi, ImageWriterSpi, and
IIOMetadata, and the instance variables on these classes must be altered to
hold the new information.
IIOMetadata.getMetadataFormat
ImageReaderWriterSpi.getStreamMetadataFormat
ImageReaderWriterSpi.getImageMetadataFormat
This requires each plug-in writer to be responsible for maintaining tedious and
redundant code, which is likely to lead to bugs.
A better solution is to require each metadata format to be described by
a different implementation class, and to require a 'public static getInstance'
method on each implementation, in the manner of the 'singleton' pattern.
Then, by providing the class names of the implementation classes to the
spi and metadata objects, a library implementation may use reflection to
do the work.
To implement this approach, additional arguments specifying whether the
plug-in supports the standard metadata format for stream and/or image metadata,
and the names of any IIOMetadataFormat implementation classes in addition
to those describing the native and standard formats must be supplied to the
constructors of ImageReaderWriterSpi, ImageReaderSpi, ImageWriterSpi, and
IIOMetadata, and the instance variables on these classes must be altered to
hold the new information.