net.wimpi.pim.contact.io.vcard
Class ItemHandlerManager

java.lang.Object
  |
  +--net.wimpi.pim.contact.io.vcard.ItemHandlerManager

public class ItemHandlerManager
extends java.lang.Object

Singleton for handling ItemHandler instances.

Version:
0.1 (22/07/2003)
Author:
Dieter Wimberger

Method Summary
 void addExtensionHandler(java.lang.String xidentifier, ItemHandler handler)
          Registers an ItemHandler for the given extension identifier.
 ItemHandler getItemHandler(java.lang.String identifier)
          Returns the ItemHandler for the item with the given identifier.
static ItemHandlerManager getReference()
          Returns the reference to this ItemHandlerManager singleton.
 boolean hasHandler(java.lang.String identifier)
          Tests if an ItemHandler for the item with the given identifier exists.
 java.lang.String[] listExtensions()
          Returns a list of all extension identifiers for which an ItemHandler has been registered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getItemHandler

public ItemHandler getItemHandler(java.lang.String identifier)
Returns the ItemHandler for the item with the given identifier.

Parameters:
identifier - an identifier as String.
Returns:
an ItemHandler instance.

hasHandler

public boolean hasHandler(java.lang.String identifier)
Tests if an ItemHandler for the item with the given identifier exists.

Parameters:
identifier - an identifier as String.
Returns:
true if it exists, false otherwise.

listExtensions

public java.lang.String[] listExtensions()
Returns a list of all extension identifiers for which an ItemHandler has been registered.

Returns:
the list of identifiers as String[].

addExtensionHandler

public void addExtensionHandler(java.lang.String xidentifier,
                                ItemHandler handler)
                         throws versitException
Registers an ItemHandler for the given extension identifier.

Parameters:
xidentifier - an identifier as String.
handler - the ItemHandler to be registered.
Throws:
versitException - if an ItemHandler has already been registered for the given extension identifier.

getReference

public static ItemHandlerManager getReference()
Returns the reference to this ItemHandlerManager singleton.

Returns:
the singleton reference.


Copyright © 2001-2003 jpim team.