xmlgraphics-commons 1.3.1

org.apache.xmlgraphics.image.loader.spi
Class ImageImplRegistry

java.lang.Object
  extended by org.apache.xmlgraphics.image.loader.spi.ImageImplRegistry

public class ImageImplRegistry
extends java.lang.Object

This class is the registry for all implementations of the various service provider interfaces for the image package.


Field Summary
protected static org.apache.commons.logging.Log log
          logger
 
Constructor Summary
ImageImplRegistry()
          Main constructor.
 
Method Summary
 void discoverClasspathImplementations()
          Discovers all implementations in the application's classpath.
static ImageImplRegistry getDefaultInstance()
          Returns the default instance of the Image implementation registry.
 int getImageConverterModifications()
          Returns the number of modifications to the collection of registered ImageConverter instances.
 java.util.Collection getImageConverters()
          Returns the Collection of registered ImageConverter instances.
 ImageLoaderFactory[] getImageLoaderFactories(ImageInfo imageInfo, ImageFlavor flavor)
          Returns an array of ImageLoaderFactory instances that support the MIME type indicated by an ImageInfo object and can generate the given image flavor.
 ImageLoaderFactory[] getImageLoaderFactories(java.lang.String mime)
          Returns an array of ImageLoaderFactory instances which support the given MIME type.
 ImageLoaderFactory getImageLoaderFactory(ImageInfo imageInfo, ImageFlavor flavor)
          Returns the best ImageLoaderFactory supporting the ImageInfo and image flavor.
 java.util.Iterator getPreloaderIterator()
          Returns an iterator over all registered ImagePreloader instances.
 void registerConverter(ImageConverter converter)
          Registers a new ImageConverter.
 void registerLoaderFactory(ImageLoaderFactory loaderFactory)
          Registers a new ImageLoaderFactory.
 void registerPreloader(ImagePreloader preloader)
          Registers a new ImagePreloader.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
logger

Constructor Detail

ImageImplRegistry

public ImageImplRegistry()
Main constructor.

See Also:
getDefaultInstance()
Method Detail

getDefaultInstance

public static ImageImplRegistry getDefaultInstance()
Returns the default instance of the Image implementation registry.

Returns:
the default instance

discoverClasspathImplementations

public void discoverClasspathImplementations()
Discovers all implementations in the application's classpath.


registerPreloader

public void registerPreloader(ImagePreloader preloader)
Registers a new ImagePreloader.

Parameters:
preloader - An ImagePreloader instance

registerLoaderFactory

public void registerLoaderFactory(ImageLoaderFactory loaderFactory)
Registers a new ImageLoaderFactory.

Parameters:
loaderFactory - An ImageLoaderFactory instance

getImageConverters

public java.util.Collection getImageConverters()
Returns the Collection of registered ImageConverter instances.

Returns:
a Collection

getImageConverterModifications

public int getImageConverterModifications()
Returns the number of modifications to the collection of registered ImageConverter instances. This is used to detect changes in the registry concerning ImageConverters.

Returns:
the number of modifications

registerConverter

public void registerConverter(ImageConverter converter)
Registers a new ImageConverter.

Parameters:
converter - An ImageConverter instance

getPreloaderIterator

public java.util.Iterator getPreloaderIterator()
Returns an iterator over all registered ImagePreloader instances.

Returns:
an iterator over ImagePreloader instances.

getImageLoaderFactory

public ImageLoaderFactory getImageLoaderFactory(ImageInfo imageInfo,
                                                ImageFlavor flavor)
Returns the best ImageLoaderFactory supporting the ImageInfo and image flavor. If there are multiple ImageLoaderFactories the one with the least usage penalty is selected.

Parameters:
imageInfo - the image info object
flavor - the image flavor.
Returns:
an ImageLoaderFactory instance or null, if no suitable implementation was found

getImageLoaderFactories

public ImageLoaderFactory[] getImageLoaderFactories(ImageInfo imageInfo,
                                                    ImageFlavor flavor)
Returns an array of ImageLoaderFactory instances that support the MIME type indicated by an ImageInfo object and can generate the given image flavor.

Parameters:
imageInfo - the image info object
flavor - the target image flavor
Returns:
the array of image loader factories

getImageLoaderFactories

public ImageLoaderFactory[] getImageLoaderFactories(java.lang.String mime)
Returns an array of ImageLoaderFactory instances which support the given MIME type. The instances are returned in no particular order.

Parameters:
mime - the MIME type to find ImageLoaderFactories for
Returns:
the array of ImageLoaderFactory instances

xmlgraphics-commons 1.3.1

Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.