/[classpath]/classpath/javax/imageio/spi/ImageReaderWriterSpi.java
ViewVC logotype

Diff of /classpath/javax/imageio/spi/ImageReaderWriterSpi.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3.2.2 by gnu_andrew, Tue Aug 2 20:12:35 2005 UTC revision 1.3.2.3 by gnu_andrew, Wed Nov 2 00:43:39 2005 UTC
# Line 38  exception statement from your version. * Line 38  exception statement from your version. *
38    
39  package javax.imageio.spi;  package javax.imageio.spi;
40    
41    import javax.imageio.metadata.IIOMetadataFormat;
42    import javax.imageio.metadata.IIOMetadataFormatImpl;
43    
44  /**  /**
45   * An abstract superclass that contains the common parts of {@link   * An abstract superclass that contains the common parts of {@link
# Line 422  public abstract class ImageReaderWriterS Line 424  public abstract class ImageReaderWriterS
424    {    {
425      return extraImageMetadataFormatNames;      return extraImageMetadataFormatNames;
426    }    }
427    
428      /**
429       * Returns an IIOMetadataFormat object that represents the requested
430       * stream metadata format or null if the given format is supported
431       * but no IIOMetadataFormat can be created for it.
432       *
433       * @param formatName the requested stream metadata format name
434       *
435       * @return an IIOMetadataFormat object or null
436       *
437       * @throws IllegalArgumentException if formatName is null or is not
438       * one of the standard metadata format or this provider's native or
439       * extra stream metadata formats
440       */
441      public IIOMetadataFormat getStreamMetadataFormat (String formatName)
442      {
443        if (formatName == null)
444          throw new IllegalArgumentException ("null stream metadata format name");
445    
446        if (!formatName.equals (getNativeStreamMetadataFormatName())
447            && !formatName.equals (IIOMetadataFormatImpl.standardMetadataFormatName))
448          {
449            String[] extraNames = getExtraStreamMetadataFormatNames ();
450            boolean foundName = false;
451            for (int i = 0; i < extraNames.length; i++)
452              {
453                if (formatName.equals(extraNames[i]))
454                  {
455                    foundName = true;
456                    break;
457                  }
458              }
459            if (!foundName)
460              throw new IllegalArgumentException ("unsupported stream metadata format name");
461          }
462    
463        if (formatName.equals (IIOMetadataFormatImpl.standardMetadataFormatName))
464          return IIOMetadataFormatImpl.getStandardFormatInstance ();
465        else
466          // Default implementation returns null.
467          return null;
468      }
469    
470      /**
471       * Returns an IIOMetadataFormat object that represents the requested
472       * image metadata format or null if the given format is supported
473       * but no IIOMetadataFormat can be created for it.
474       *
475       * @param formatName the requested image metadata format name
476       *
477       * @return an IIOMetadataFormat object or null
478       *
479       * @throws IllegalArgumentException if formatName is null or is not
480       * one of the standard metadata format or this provider's native or
481       * extra image metadata formats
482       */
483      public IIOMetadataFormat getImageMetadataFormat (String formatName)
484      {
485        if (formatName == null)
486          throw new IllegalArgumentException ("null image metadata format name");
487    
488        if (!formatName.equals (getNativeImageMetadataFormatName())
489            && !formatName.equals (IIOMetadataFormatImpl.standardMetadataFormatName))
490          {
491            String[] extraNames = getExtraImageMetadataFormatNames ();
492            boolean foundName = false;
493            for (int i = 0; i < extraNames.length; i++)
494              {
495                if (formatName.equals(extraNames[i]))
496                  {
497                    foundName = true;
498                    break;
499                  }
500              }
501            if (!foundName)
502              throw new IllegalArgumentException ("unsupported image metadata format name");
503          }
504    
505        if (formatName.equals (IIOMetadataFormatImpl.standardMetadataFormatName))
506          return IIOMetadataFormatImpl.getStandardFormatInstance ();
507        else
508          // Default implementation returns null.
509          return null;
510      }
511  }  }

Legend:
Removed from v.1.3.2.2  
changed lines
  Added in v.1.3.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26