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

Field Detail

providesMethodName

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

See Also:
Constant Field Values
Method Detail

providedClasses

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(Class<?> sourceClass,
                          Type[] sourceTypes,
                          Class<?> targetClass,
                          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:

convert

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

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


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