public class ALDDataConverterManager extends Object
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
.
Modifier and Type | Class and Description |
---|---|
static class |
ALDDataConverterManager.ALDSourceTargetClassPair
A pair of source and target pair (of a converter)
|
Modifier and Type | Field and Description |
---|---|
private static boolean |
debug |
(package private) static ALDDataConverterManager |
instance
The singleton instance of this class.
|
protected HashMap<String,Collection<String>> |
mapTable
Hashtable containing mappings of class pairs to a collection of provider class names.
|
Modifier | Constructor and Description |
---|---|
private |
ALDDataConverterManager()
Private constructor which initializes the provider map.
|
Modifier and Type | Method and Description |
---|---|
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) |
private static boolean debug
protected HashMap<String,Collection<String>> mapTable
static final ALDDataConverterManager instance
private ALDDataConverterManager()
ALDDataConverterManagerException
public static ALDDataConverterManager getInstance()
public Object convert(Object sourceObject, Type[] sourceTypes, Class<?> targetClass, Type[] targetTypes) throws ALDDataConverterException, ALDDataConverterManagerException
sourceObject
into an object of class
targetClass
.sourceObject
- sourceTypes
- targetClass
- targetTypes
- ALDDataConverterException
ALDDataConverterManagerException
public Object convert(ALDDataConverter provider, Object sourceObject, Field sourceField, Class<?> targetClass, Field targetField) throws ALDDataConverterManagerException, ALDDataConverterException
sourceObject
into an object of class
targetClass
.sourceObject
- sourceTypes
- targetClass
- targetTypes
- ALDDataConverterManagerException
ALDDataConverterException
public Object convert(Object sourceObject, Field sourceField, Class<?> targetClass, Field targetField) throws ALDDataConverterManagerException, ALDDataConverterException
public Object convert(Object sourceObject, Class<?> targetClass) throws ALDDataConverterManagerException, ALDDataConverterException
sourceObject
into an object of class
targetClass
.sourceObject
- targetClass
- ALDDataConverterManagerException
ALDDataConverterException
public ALDDataConverter getProvider(Class<?> sourceClass, Type[] sourceTypes, Class<?> targetClass, Type[] targetTypes) throws ALDDataConverterManagerException
sourceClass
- targetClass
- ALDDataConverterManagerException
ALDDataIOManagerException
public ALDDataConverter getProvider(Class<?> sourceClass, Field sourceField, Class<?> targetClass, Field targetField) throws ALDDataConverterManagerException
ALDDataConverterManagerException
protected static HashMap<String,Collection<String>> initMapTable()
ALDDataConverterManagerException
public static void printMap(HashMap<String,Collection<String>> mapTable)
Copyright © 2010–2021 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.