OpenOffice.org
XMerge API

org.openoffice.xmerge.util.registry
Class ConverterInfoMgr

java.lang.Object
  |
  +--org.openoffice.xmerge.util.registry.ConverterInfoMgr

public final class ConverterInfoMgr
extends java.lang.Object

Manages the converter plug-ins that are currently active. This class allows plug-ins to be added or removed dynamically. This class is a singleton (static) class, so that only one manager can exist at a time. It is final, so it may not be subclassed.


Constructor Summary
ConverterInfoMgr()
           
 
Method Summary
static void addPlugIn(ConverterInfo ci)
          Adds a converter plug-in to the registry.
static void addPlugIn(java.util.Enumeration jarEnum)
          Adds a Vector of converter plug-ins to the registry.
static ConverterInfo findConverterInfo(java.lang.String deviceMime, java.lang.String officeMime)
          Returns the ConverterInfo object that supports the specified device/office mime type conversion.
static ConverterInfo[] findConverterInfoChain(java.lang.String deviceFromMime, java.lang.String deviceToMime)
          Returns an array of two ConverterInfo objects that can be chained to perform the specified mime type conversion.
static java.util.Enumeration getConverterInfoEnumeration()
          Returns an Enumeration of registered ConverterInfo objects.
static void main(java.lang.String[] args)
          main to let the user specify what plug-ins to register from jarfiles and to display the currently registered plug-ins.
static boolean removeByJar(java.lang.String jar)
          Removes any ConverterInfo object from the registry that have the specified jar name value.
static boolean removeByName(java.lang.String name)
          Removes any ConverterInfo object from the registry that have the specified display name value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConverterInfoMgr

public ConverterInfoMgr()
Method Detail

addPlugIn

public static void addPlugIn(ConverterInfo ci)
                      throws RegistryException
Adds a converter plug-in to the registry. The ConverterInfo must have a unique DisplayName and must have non-null values for DisplayName, ClassImpl, OfficeMime, and DeviceMime.
Parameters:
ConverterInfo - A ConverterInfo object describing a plug-in.
Throws:
RegistryException - If the ConverterInfo is not valid.

addPlugIn

public static void addPlugIn(java.util.Enumeration jarEnum)
                      throws RegistryException
Adds a Vector of converter plug-ins to the registry. Each ConverterInfo in the Vector must have a unique DisplayName and must have non-null values for DisplayName, ClassImpl, OfficeMime, and DeviceMime.
Parameters:
ciVectory - A Vector of ConverterInfo objects describing one or more plug-in(s).
Throws:
RegistryException - If a ConverterInfo in the Vector is not valid.

findConverterInfo

public static ConverterInfo findConverterInfo(java.lang.String deviceMime,
                                              java.lang.String officeMime)
Returns the ConverterInfo object that supports the specified device/office mime type conversion. If there are multiple ConverterInfo objects registered that support this conversion, only the first is returned.
Parameters:
deviceMime - The device mime.
officeMime - The office mime.
Returns:
The first plug-in that supports the specified conversion.

findConverterInfoChain

public static ConverterInfo[] findConverterInfoChain(java.lang.String deviceFromMime,
                                                     java.lang.String deviceToMime)
Returns an array of two ConverterInfo objects that can be chained to perform the specified mime type conversion. If there are multiple ConverterInfo objects that support this conversion, only the first is returned.
Parameters:
deviceMimeFrom - The device from mime.
deviceMimeTo - The device to mime.
Returns:
An array of two ConverterInfo objects that can be chained to perform the specified conversion.

getConverterInfoEnumeration

public static java.util.Enumeration getConverterInfoEnumeration()
Returns an Enumeration of registered ConverterInfo objects.
Returns:
An Enumeration containing the currently registered ConverterInfo objects, an empty Vector if none exist.

main

public static void main(java.lang.String[] args)
main to let the user specify what plug-ins to register from jarfiles and to display the currently registered plug-ins.
Parameters:
args - Not used.

removeByJar

public static boolean removeByJar(java.lang.String jar)
Removes any ConverterInfo object from the registry that have the specified jar name value.
Parameters:
jar - The name of the jarfile.
Returns:
True if a ConverterInfo object was removed, false otherwise.

removeByName

public static boolean removeByName(java.lang.String name)
Removes any ConverterInfo object from the registry that have the specified display name value.
Parameters:
name - The display name.
Returns:
True if a ConverterInfo object was removed, false otherwise.

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org