10.6.3. custom Transformer 选项
注意
转换器必须是 org.apache.camel.spi.Transformer
的子类
名称 | 描述 |
---|---|
ref | 引用自定义 Transformer bean ID |
className | 自定义 Transformer 类的完全限定类名称 |
指定 custom Transformer 类的示例:
Java DSL:
transformer() .fromType("xml") .toType("json") .withJava(com.example.MyCustomTransformer.class);
XML DSL:
<transformers> <customTransformer className="com.example.MyCustomTransformer" fromType="xml" toType="json"/> </transformers>