I'm trying to write an DSL for doing typesafe conversions from one object to another.
src classA
dst classB
map valueA to valueB with ConverterX
map valueC to valueD with ConverterY
the result should be something like:
class Converter
{
public void convert(ClassA a, ClassB b)
{
a.setValueA(ConverterX.convert(b.getValueB))
b.setValueC(ConverterY.convert(b.getValueD))
}
}
I simply want to generate the code for that, but i'm not able to access the classes I already defined. The reason for that is to be able to use default converters. Only in case I am able to get the type of the parameters, i will be able to choose the implementation for the default converter.