de.unihalle.informatik.Alida.dataconverter
Class ALDNumberConverter

java.lang.Object
  extended by de.unihalle.informatik.Alida.operator.ALDOperator
      extended by de.unihalle.informatik.Alida.dataconverter.ALDNumberConverter
All Implemented Interfaces:
ALDDataConverter, ALDConfigurationValidator

@ALDDataConverterProvider
public class ALDNumberConverter
extends ALDOperator
implements ALDDataConverter

Converts numbers.

Author:
posch

Nested Class Summary
 
Nested classes/interfaces inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
ALDOperator.HidingMode
 
Field Summary
private static java.util.LinkedList<java.lang.Class> numberClasses
           
(package private)  java.lang.Object sourceObject
           
(package private)  java.lang.Class<?> targetClass
           
(package private)  java.lang.Object targetObject
           
 
Fields inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
completeDAG, name, portHashAccess, verbose, versionProvider
 
Fields inherited from interface de.unihalle.informatik.Alida.dataconverter.ALDDataConverter
providesMethodName
 
Constructor Summary
ALDNumberConverter()
          Default constructor.
 
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.
protected  void operate()
          This method does the actual work and needs to be implemented by every subclass.
 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.
 
Methods inherited from class de.unihalle.informatik.Alida.operator.ALDOperator
deserializeFromXmlFile, fieldContained, getALDPortHashAccessKey, getConstructionMode, getInInoutNames, getInInoutNames, getInNames, getInOutNames, getMissingRequiredInputs, getName, getNumParameters, getOutInoutNames, getOutNames, getParameter, getParameterDescriptor, getParameterNames, getSupplementalNames, getVerbose, getVersion, isConfigured, parametersToXmlObject, print, print, print, printInterface, printInterface, readHistory, readResolve, reinitializeParameterDescriptors, runOp, runOp, runOp, serializeToXmlFile, setConstructionMode, setName, setParameter, setParametersFromXml, setParametersFromXml, setVerbose, toStringVerbose, unconfiguredItems, validate, validateCustom, validateGeneric, writeHistory, writeHistory, writeHistory, writeParametersToXml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numberClasses

private static java.util.LinkedList<java.lang.Class> numberClasses

sourceObject

@Parameter(label="Source Object",
           required=true,
           direction=IN,
           supplemental=false,
           description="Source object to convert.")
java.lang.Object sourceObject

targetClass

@Parameter(label="Target Class",
           required=true,
           direction=IN,
           supplemental=false,
           description="Class of target object.")
java.lang.Class<?> targetClass

targetObject

@Parameter(label="Target Object",
           direction=OUT,
           supplemental=false,
           description="Target object.")
java.lang.Object targetObject
Constructor Detail

ALDNumberConverter

public ALDNumberConverter()
                   throws ALDOperatorException
Default constructor.

Throws:
ALDOperatorException
Method Detail

convert

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

Specified by:
convert in interface ALDDataConverter
Returns:
converted object
Throws:
ALDDataConverterException

operate

protected void operate()
                throws ALDOperatorException
Description copied from class: ALDOperator
This method does the actual work and needs to be implemented by every subclass.

Specified by:
operate in class ALDOperator
Throws:
ALDOperatorException

providedClasses

public java.util.Collection<ALDDataConverterManager.ALDSourceTargetClassPair> providedClasses()
Description copied from interface: ALDDataConverter
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

Specified by:
providedClasses in interface ALDDataConverter
Returns:
Collection of classes provided

supportConversion

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

Specified by:
supportConversion in interface ALDDataConverter
Returns: