com.arsdigita.mimetypes.image
Class ImageSizerFactory

java.lang.Object
  extended bycom.arsdigita.mimetypes.image.ImageSizerFactory

public class ImageSizerFactory
extends Object

Implements the Factory pattern in order to supply implementation-specific instances of ImageSizer. The factory is initialized in the mime-type initializer.

Version:
$Id: //core-platform/dev/src/com/arsdigita/mimetypes/image/ImageSizerFactory.java#4 $
Author:
Stanislav Freidin

Field Summary
static String versionId
           
 
Constructor Summary
ImageSizerFactory()
          Constructor
 
Method Summary
static void addImageSizer(String mime, ImageSizer sizer)
          Add an ImageSizer instance to the factory
static ImageSizer getImageSizer(String mime)
          Obtain an instance of an ImageSizer which can determine the size of an image with the given mime-type.
static void initialize()
          Initialize the factory by loading all image sizers from the database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values
Constructor Detail

ImageSizerFactory

public ImageSizerFactory()
Constructor

Method Detail

addImageSizer

public static void addImageSizer(String mime,
                                 ImageSizer sizer)
Add an ImageSizer instance to the factory

Parameters:
mime - the mime-type of the image which the image sizer is able to handle
sizer - an implementation-specific instance of ImageSizer

getImageSizer

public static ImageSizer getImageSizer(String mime)
Obtain an instance of an ImageSizer which can determine the size of an image with the given mime-type.

Parameters:
mime - the mime-type of the image which the image sizer should handle
Returns:
an appropriate instance of ImageSizer, or null if no such instance exists

initialize

public static void initialize()
Initialize the factory by loading all image sizers from the database



Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC