javax.media.jai
Class RegistryMode

java.lang.Object
  extended byjavax.media.jai.RegistryMode
Direct Known Subclasses:
CollectionRegistryMode, RemoteRenderableRegistryMode, RemoteRenderedRegistryMode, RenderableCollectionRegistryMode, RenderableRegistryMode, RenderedRegistryMode, TileDecoderRegistryMode, TileEncoderRegistryMode

public class RegistryMode
extends Object

A class which provides information about a registry mode. The static methods of the class act to maintain a global list of known modes. All RegistryModes known to JAI are added to this list when this class is loaded. The RegistryModes installed by JAI cannot be replaced or removed. The Strings used to represent the registry modes are all used in a case-insensitive manner.

Since:
JAI 1.1

Constructor Summary
protected RegistryMode(String name, Class descriptorClass, Class productClass, Method factoryMethod, boolean arePreferencesSupported, boolean arePropertiesSupported)
          Constructor.
 
Method Summary
static boolean addMode(RegistryMode mode)
          Adds a new RegistryMode to the existing list.
 boolean arePreferencesSupported()
          Does this registry mode support preferences ?
 boolean arePropertiesSupported()
          Are properties to be managed for this registry mode ?
 Class getDescriptorClass()
          Returns the descriptor class that corresponds to this registry mode.
static Set getDescriptorClasses()
          Get a Set of all descriptor classes over all registry modes.
 Class getFactoryClass()
          A convenience method which essentially returns getFactoryMethod().getDeclaringClass()
 Method getFactoryMethod()
          Get the factory method that corresponds to "create"
static RegistryMode getMode(String name)
          Get the registry mode corresponding to this name.
static String[] getModeNames()
          Get the list of the known registry mode names.
static String[] getModeNames(Class descriptorClass)
          Get a list of all known registry modes associated with the specified descriptorClass.
 String getName()
          Get the registry mode name (case-preserved)
 Class getProductClass()
          The Class of the objects produced by this registry mode.
static boolean removeMode(String name)
          Removes a mode from the existing list of known registryModes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryMode

protected RegistryMode(String name,
                       Class descriptorClass,
                       Class productClass,
                       Method factoryMethod,
                       boolean arePreferencesSupported,
                       boolean arePropertiesSupported)
Constructor. Protected access allows only instantiation of subclasses.

Parameters:
name - name of the registry mode
descriptorClass - the specific sub-class of RegistryElementDescriptor associated with this registry mode.
productClass - the Class of the objects produced by this registry mode. This would typically be factoryMethod.getReturnType().
factoryMethod - the method used to "create" an object.
arePreferencesSupported - does this registry mode support preferences between products or instances of the "modes"
arePropertiesSupported - do properties have to be managed for this registry mode.
Method Detail

addMode

public static boolean addMode(RegistryMode mode)
Adds a new RegistryMode to the existing list. This succeeds only if the mode is not already present in the list. New RegistryMode names can not clash (in a case insensitive manner) with the ones installed by JAI (done statically when this class is loaded)

Parameters:
mode - the new RegistryMode to be added to list
Returns:
false if the mode was already in the list. true otherwise

removeMode

public static boolean removeMode(String name)
Removes a mode from the existing list of known registryModes. If the mode is one of the JAI-installed ones, it can not be removed.

Returns:
false if the mode can not be removed because it was added by JAI or because the mode was not previously add. returns true otherwise.

getModeNames

public static String[] getModeNames()
Get the list of the known registry mode names.

Returns:
null, if there are no registered modes. Otherwise returns an array of Strings of registered mode names.

getModeNames

public static String[] getModeNames(Class descriptorClass)
Get a list of all known registry modes associated with the specified descriptorClass.

Parameters:
descriptorClass - a Class
Returns:
null if there are no modes registered against the specified descriptorClass. Otherwise returns an array of Strings of mode names associated with the descriptorClass.

getMode

public static RegistryMode getMode(String name)
Get the registry mode corresponding to this name.


getDescriptorClasses

public static Set getDescriptorClasses()
Get a Set of all descriptor classes over all registry modes.


getName

public final String getName()
Get the registry mode name (case-preserved)


getFactoryMethod

public final Method getFactoryMethod()
Get the factory method that corresponds to "create"


arePreferencesSupported

public final boolean arePreferencesSupported()
Does this registry mode support preferences ?


arePropertiesSupported

public final boolean arePropertiesSupported()
Are properties to be managed for this registry mode ?


getDescriptorClass

public final Class getDescriptorClass()
Returns the descriptor class that corresponds to this registry mode. For eg. this would be OperationDescriptor for rendered, renderable, collection ... and TileCodecDescriptor for tilecodec etc.


getProductClass

public final Class getProductClass()
The Class of the objects produced by this registry mode.


getFactoryClass

public final Class getFactoryClass()
A convenience method which essentially returns getFactoryMethod().getDeclaringClass()