public abstract class ALDDataIOManager extends Object
ALDDataIOProvider
and are expected to
implement an interface which is derived from the interface ALDDataIO
.
Each non-abstract class extending ALDDataIOManager will typically come in pair with an interface which extends ALDDataIO. The class extending ALDDataIOManager defines methods to read and write data which are delegated to the corresponding corresponding classes defined in the pairing interface and thus have to be defined there.
ALDDataIO
Modifier and Type | Field and Description |
---|---|
protected static boolean |
debug
For internal debugging purposes
|
protected HashMap<Class,String> |
mapTable
Hashtable containing mappings of datatypes to DataIO provider classes.
|
private static String |
providedClassesMethodName
Name of the method which returns all classes supported by a DataIO provider class.
|
Modifier | Constructor and Description |
---|---|
protected |
ALDDataIOManager()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
ALDDataIO |
getProvider(Class cl,
Class interfaceRequired)
Method to return an instance of the DataIO provider class for the class
cl
which implements the requested interface interfaceRequired
(which has itself to implement ALDDataIO). |
HashMap<Class,String> |
getProviderMap()
Method to return a clone of the mapping of classes to dataIO providers.
|
protected static HashMap<Class,String> |
initMapTable(Class interfaceRequired)
Method to initialize the hashmap which registers DataIO providers.
|
protected static boolean debug
private static String providedClassesMethodName
ALDDataIO
and thus to be implemented
by each DataIO provider class.protected static HashMap<Class,String> initMapTable(Class interfaceRequired)
ALDDataIO
, i.e.
a DataIO provider will only be found and registerd, if it is annotated with @ALDDataIO.
In addition it has to implement the interface interfaceRequired
.interfaceRequired
- Interface which all providers registered are to implement.
Is has to be derived from ALDDataIO
.public ALDDataIO getProvider(Class cl, Class interfaceRequired) throws ALDDataIOManagerException
cl
which implements the requested interface interfaceRequired
(which has itself to implement ALDDataIO).
There are the following extensions if no DataIO provider for class cl
is found.
If cl
is an enumeration class, a provider for Enum.class is returned (if found).
If cl
is an ALDOperator class, a provider for ALDOperator.class is returned (if found).
If cl
is an array, a provider for Array.class is returned (if found).
If cl
is a Collection, a provider for Collection.class is returned (if found).
If cl
is annotated as a parametrized class via ALDParametrizedClass
,
a provider for ALDParametrizedClassDummy
is returned (if found).
cl
- class to get an provider forinterfaceRequired
- interface needed to be implemented by the providerALDDataIOManagerException
Copyright © 2010–2021 Martin Luther University Halle-Wittenberg, Institute of Computer Science, Pattern Recognition and Bioinformatics. All rights reserved.