intarsys runtime library

de.intarsys.tools.converter
Class DoubleDispatchConverter

java.lang.Object
  extended by de.intarsys.tools.converter.DoubleDispatchConverter
All Implemented Interfaces:
IConverter<Object,Object>

public class DoubleDispatchConverter
extends Object
implements IConverter<Object,Object>

Double dispatch converter.

This is the result of the first stage in the conversion process. A IConverter that bundles all IConverter instances that can create a dedicated target type. Amongst the sub-converters the one is selected that most closely supports the source object type.


Constructor Summary
DoubleDispatchConverter(Class targetType)
           
 
Method Summary
 Object convert(Object source)
          Convert the actual source object.
 Class<?> getSourceType()
          The source type the converter supports.
 Class<?> getTargetType()
          The target type the converter supports.
 void registerConverter(IConverter converter)
           
 void unregisterConverter(IConverter converter)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleDispatchConverter

public DoubleDispatchConverter(Class targetType)
Method Detail

convert

public Object convert(Object source)
               throws ConversionException
Description copied from interface: IConverter
Convert the actual source object.

Specified by:
convert in interface IConverter<Object,Object>
Returns:
The converted object.
Throws:
ConversionException

getSourceType

public Class<?> getSourceType()
Description copied from interface: IConverter
The source type the converter supports.

Specified by:
getSourceType in interface IConverter<Object,Object>
Returns:
The source type the converter supports.

getTargetType

public Class<?> getTargetType()
Description copied from interface: IConverter
The target type the converter supports.

Specified by:
getTargetType in interface IConverter<Object,Object>
Returns:
The target type the converter supports.

registerConverter

public void registerConverter(IConverter converter)

unregisterConverter

public void unregisterConverter(IConverter converter)

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.