de.unihalle.informatik.Alida.batch
Class ALDBatchInputManager

java.lang.Object
  extended by de.unihalle.informatik.Alida.batch.ALDBatchInputManager
Direct Known Subclasses:
ALDBatchInputManagerSwing

public abstract class ALDBatchInputManager
extends java.lang.Object

Class to manage data inputs in batch processing with operators.

Author:
moeller

Field Summary
protected static boolean debug
          For internal debugging purposes only.
protected  java.util.HashMap<java.lang.Class<?>,java.lang.String> mapTable
          Hashtable containing mappings of datatypes to provider classes.
private static java.lang.String providedInputClassesMethodName
          Name of the method which returns all classes supported.
 
Constructor Summary
protected ALDBatchInputManager()
          Default constructor.
 
Method Summary
 ALDBatchInputIterator getProvider(java.lang.Class<?> cl, java.lang.Class<?> interfaceRequired)
          Method to return an instance of the batch input provider for given class.
protected static java.util.HashMap<java.lang.Class<?>,java.lang.String> initMapTable(java.lang.Class<?> interfaceRequired)
          Method to initialize the hashmap which registers batch input providers.
 boolean providerAvailable(java.lang.Class<?> cl)
          Check if a provider has registered for the given class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected static boolean debug
For internal debugging purposes only.


mapTable

protected java.util.HashMap<java.lang.Class<?>,java.lang.String> mapTable
Hashtable containing mappings of datatypes to provider classes.


providedInputClassesMethodName

private static java.lang.String providedInputClassesMethodName
Name of the method which returns all classes supported.

Constructor Detail

ALDBatchInputManager

protected ALDBatchInputManager()
Default constructor.

Method Detail

getProvider

public ALDBatchInputIterator getProvider(java.lang.Class<?> cl,
                                         java.lang.Class<?> interfaceRequired)
                                  throws ALDBatchIOManagerException
Method to return an instance of the batch input provider for given class.

A provider is returned which implements the requested interface interfaceRequired (which is by itself required to implement ALDBatchInputIterator).

Parameters:
cl - Class to get a provider for.
interfaceRequired - Interface needed to be implemented by provider.
Returns:
Provider instance.
Throws:
ALDDataIOManagerException
ALDBatchIOManagerException

initMapTable

protected static java.util.HashMap<java.lang.Class<?>,java.lang.String> initMapTable(java.lang.Class<?> interfaceRequired)
Method to initialize the hashmap which registers batch input providers.

Parameters:
interfaceRequired - Interface of which providers are registered.

providerAvailable

public boolean providerAvailable(java.lang.Class<?> cl)
Check if a provider has registered for the given class.

Note that this function does not try to instantiate a provider, thus, just a flat check is done, and on lateron requesting a provider object errors are still possible.

Parameters:
cl - Requested class.
Returns:
True, if a provider has registered.