de.unihalle.informatik.Alida.dataconverter
Class ALDDataConverterManager

java.lang.Object
  extended by de.unihalle.informatik.Alida.dataconverter.ALDDataConverterManager

public class ALDDataConverterManager
extends Object

This class implements a provider manager for data conversion.

For data input, it essentially looks up the correct provider for GUI-based execution using the method of its super class and invokes its method.

It does its work in collaboration with ALDDataConverter.

Author:
posch

Nested Class Summary
static class ALDDataConverterManager.ALDSourceTargetClassPair
          A pair of source and target pair (of a converter)
 
Field Summary
protected  HashMap<String,Collection<String>> mapTable
          Hashtable containing mappings of class pairs to a collection of provider class names.
 
Method Summary
 Object convert(ALDDataConverter provider, Object sourceObject, Field sourceField, Class<?> targetClass, Field targetField)
          Convert the sourceObject into an object of class targetClass.
 Object convert(Object sourceObject, Class<?> targetClass)
          Convert the sourceObject into an object of class targetClass.
 Object convert(Object sourceObject, Field sourceField, Class<?> targetClass, Field targetField)
           
 Object convert(Object sourceObject, Type[] sourceTypes, Class<?> targetClass, Type[] targetTypes)
          Convert the sourceObject into an object of class targetClass.
static ALDDataConverterManager getInstance()
          Return the single instance of this class
 ALDDataConverter getProvider(Class<?> sourceClass, Field sourceField, Class<?> targetClass, Field targetField)
           
 ALDDataConverter getProvider(Class<?> sourceClass, Type[] sourceTypes, Class<?> targetClass, Type[] targetTypes)
          Method to return an instance of the data converter provider for given classes.
protected static HashMap<String,Collection<String>> initMapTable()
          Method to initialize the hashmap which registers data conversion providers.
static void printMap(HashMap<String,Collection<String>> mapTable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapTable

protected HashMap<String,Collection<String>> mapTable
Hashtable containing mappings of class pairs to a collection of provider class names.

Method Detail

getInstance

public static ALDDataConverterManager getInstance()
Return the single instance of this class

Returns:
Single instance.

convert

public Object convert(Object sourceObject,
                      Type[] sourceTypes,
                      Class<?> targetClass,
                      Type[] targetTypes)
               throws ALDDataConverterException,
                      ALDDataConverterManagerException
Convert the sourceObject into an object of class targetClass.

Parameters:
sourceObject -
sourceTypes -
targetClass -
targetTypes -
Returns:
Throws:
ALDDataConverterException
ALDDataConverterManagerException

convert

public Object convert(ALDDataConverter provider,
                      Object sourceObject,
                      Field sourceField,
                      Class<?> targetClass,
                      Field targetField)
               throws ALDDataConverterManagerException,
                      ALDDataConverterException
Convert the sourceObject into an object of class targetClass.

Parameters:
sourceObject -
sourceTypes -
targetClass -
targetTypes -
Returns:
Throws:
ALDDataConverterManagerException
ALDDataConverterException

convert

public Object convert(Object sourceObject,
                      Field sourceField,
                      Class<?> targetClass,
                      Field targetField)
               throws ALDDataConverterManagerException,
                      ALDDataConverterException
Throws:
ALDDataConverterManagerException
ALDDataConverterException

convert

public Object convert(Object sourceObject,
                      Class<?> targetClass)
               throws ALDDataConverterManagerException,
                      ALDDataConverterException
Convert the sourceObject into an object of class targetClass.

Parameters:
sourceObject -
targetClass -
Returns:
converted object
Throws:
ALDDataConverterManagerException
ALDDataConverterException

getProvider

public ALDDataConverter getProvider(Class<?> sourceClass,
                                    Type[] sourceTypes,
                                    Class<?> targetClass,
                                    Type[] targetTypes)
                             throws ALDDataConverterManagerException
Method to return an instance of the data converter provider for given classes.

Parameters:
sourceClass -
targetClass -
Returns:
Provider instance.
Throws:
ALDDataConverterManagerException
ALDDataIOManagerException

getProvider

public ALDDataConverter getProvider(Class<?> sourceClass,
                                    Field sourceField,
                                    Class<?> targetClass,
                                    Field targetField)
                             throws ALDDataConverterManagerException
Throws:
ALDDataConverterManagerException

initMapTable

protected static HashMap<String,Collection<String>> initMapTable()
Method to initialize the hashmap which registers data conversion providers.

Throws:
ALDDataConverterManagerException

printMap

public static void printMap(HashMap<String,Collection<String>> mapTable)


Copyright © 2010–2014 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.