de.unihalle.informatik.Alida.dataconverter
Interface ALDDataConverter

All Known Implementing Classes:
ALDNumberConverter, ALDVectorNativeArrayConverter

public interface ALDDataConverter

Super class for all data converter providers in Alida. A provider is required to convert objects of any type announced by sourceClasses to an object of any type announced by targetClasses.

Author:
posch

Field Summary
static java.lang.String providesMethodName
          Name of the method which returns all source classes supported.
 
Method Summary
 java.lang.Object convert(java.lang.Object sourceObject, java.lang.reflect.Type[] sourceTypes, java.lang.Class<?> targetClass, java.lang.reflect.Type[] targetTypes)
          Convert the sourceObject into an object of class targetClass.
 java.util.Collection<ALDDataConverterManager.ALDSourceTargetClassPair> providedClasses()
          Announce all classes pairs which the converter can handle.
 boolean supportConversion(java.lang.Class<?> sourceClass, java.lang.reflect.Type[] sourceTypes, java.lang.Class<?> targetClass, java.lang.reflect.Type[] targetTypes)
          Does the converter support this kind of conversion.
 

Field Detail

providesMethodName

static final java.lang.String providesMethodName
Name of the method which returns all source classes supported.

See Also:
Constant Field Values
Method Detail

convert

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

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

providedClasses

java.util.Collection<ALDDataConverterManager.ALDSourceTargetClassPair> providedClasses()
Announce all classes pairs which the converter can handle.

Note: for parameterized types there is only indicates that the converter can in principle handle conversion for these classes but depending und the type parameters still may refuse to convert

Returns:
Collection of classes provided

supportConversion

boolean supportConversion(java.lang.Class<?> sourceClass,
                          java.lang.reflect.Type[] sourceTypes,
                          java.lang.Class<?> targetClass,
                          java.lang.reflect.Type[] targetTypes)
Does the converter support this kind of conversion. For not parameterized types type type arrays are ignored, of course.

Parameters:
sourceClass -
sourceTypes -
targetClass -
targetTypes -
Returns: