2 Replies Latest reply on Aug 13, 2012 1:23 AM by Claus Ibsen

    Type converter feature request

    jamie archibald Apprentice

      Currently the following works:

       

      public class TracePointTypeConverterTest extends CamelTestSupport {

       

           @Test

           public void lookup() {

                assertNotNull(context.getTypeConverterRegistry().lookup(SomeObject.class, AnotherObject.class));

           }

      }

       

      @Converter

      public class MyTypeConverter {

       

         @Converter

         public SomeObject convert(AnotherObject obj, Exchange exg) {

             String foo = exg.getIn().getHeader("foo", String.class);

             // do something

         }

      }

       

       

      This however does not work and the unit test fails:

       

      @Converter

      public class MyTypeConverter {

       

         @Converter

         public SomeObject convert(AnotherObject obj, @Header("foo") String foo, ...) {

             // do something

         }

      }