com.vinculumtech.carrierwave.typemap
Class DynamicImageTypeMap

java.lang.Object
  extended bycom.vinculumtech.carrierwave.typemap.ImageTypeMap
      extended bycom.vinculumtech.carrierwave.typemap.DynamicImageTypeMap
All Implemented Interfaces:
java.io.Serializable

public class DynamicImageTypeMap
extends ImageTypeMap

A DynamicImageTypeMap is capable of having types registered at run time. In the future, this needs to be fleshed out so that types can also be unregistered (perhaps by grouping the registrations.)

On initialization, it will automatically load all typemaps found by the ClassLoader at the location specified by TYPEMAP_RESOURCE_LOCATION.

Version:
$Id: //depot/carrierwave/src/shared/com/vinculumtech/carrierwave/typemap/DynamicImageTypeMap.java#8 $
See Also:
Serialized Form

Field Summary
static java.lang.String COMMON_CLASS_PROPERTY
           
static java.lang.String PREFIX_IMAGEABLE_PROPERTY
           
static java.lang.String PREFIX_INTERFACE_PROPERTY
           
static java.lang.String TYPEMAP_RESOURCE_LOCATION
          The standard location of typemaps.
 
Constructor Summary
DynamicImageTypeMap()
           
 
Method Summary
protected  void addMapping(java.lang.String key, java.lang.String value)
          If possible, add a mapping for the given property entry.
protected  java.util.Enumeration getStandardTypeMaps()
          Find all typemaps at the standard location.
protected  void initMap()
          Import typemap.properties from standard location.
 void register(java.util.Properties typeMap)
          Add the mappings in the given properties object to this type map.
 void register(java.net.URL url)
          Register the typemap located at the specified URL.
 
Methods inherited from class com.vinculumtech.carrierwave.typemap.ImageTypeMap
addImageableImageMapping, addInterfaceImageableMapping, getCommonImageableType, getImageableClassForImageType, getImageableTypeForImageInterfaceType, getImageableTypeForImageType, getImageableTypeMap, getImageClassForImageableType, getImageForImageableType, getImageInterfaceTypeMap, getImageTypeForImageableType, getImageTypeMap, getName, hasMappingForImageableType, hasMappingForImageInterfaceType, hasMappingForImageType, isImageableType, isImageInterfaceType, isImageType, setCommonImageableType, setImageableTypeMap, setImageInterfaceTypeMap, setImageTypeMap, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPEMAP_RESOURCE_LOCATION

public static final java.lang.String TYPEMAP_RESOURCE_LOCATION
The standard location of typemaps.

See Also:
Constant Field Values

COMMON_CLASS_PROPERTY

public static final java.lang.String COMMON_CLASS_PROPERTY
See Also:
Constant Field Values

PREFIX_IMAGEABLE_PROPERTY

public static final java.lang.String PREFIX_IMAGEABLE_PROPERTY
See Also:
Constant Field Values

PREFIX_INTERFACE_PROPERTY

public static final java.lang.String PREFIX_INTERFACE_PROPERTY
See Also:
Constant Field Values
Constructor Detail

DynamicImageTypeMap

public DynamicImageTypeMap()
Method Detail

getStandardTypeMaps

protected java.util.Enumeration getStandardTypeMaps()
Find all typemaps at the standard location.

Returns:

initMap

protected void initMap()
Import typemap.properties from standard location.

Specified by:
initMap in class ImageTypeMap

addMapping

protected void addMapping(java.lang.String key,
                          java.lang.String value)
If possible, add a mapping for the given property entry.

Parameters:
key -
value -

register

public void register(java.util.Properties typeMap)
              throws GraphException
Add the mappings in the given properties object to this type map.

Parameters:
typeMap -
Throws:
GraphException

register

public void register(java.net.URL url)
              throws GraphException
Register the typemap located at the specified URL.

Parameters:
url -
Throws:
GraphException


Copyright (C) 2002 Vinculum Technologies, Inc. All Rights Reserved.