Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.此内容没有您所选择的语言版本。
16.2. Create a Custom Context Mapper
Procedure 16.1. Create a Custom Context Mapper
- Implement the
org.switchyard.component.common.composer.ContextMapper
interface:public interface ContextMapper<T> { void mapFrom(T source, Context context) throws Exception; void mapTo(Context context, T target) throws Exception; }
public interface ContextMapper<T> { void mapFrom(T source, Context context) throws Exception; void mapTo(Context context, T target) throws Exception; }
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Specify your implementation in your
switchyard.xml
file:<binding.xyz ...> <contextMapper class="com.example.MyContextMapper"/> </binding.xyz>
<binding.xyz ...> <contextMapper class="com.example.MyContextMapper"/> </binding.xyz>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Alternatively, you can implement the
org.switchyard.component.common.composer.RegexContextMapper
interface, which adds regular expression support:Copy to Clipboard Copied! Toggle word wrap Toggle overflow