Show Table of Contents
16.2. Create a Custom Context Mapper
Procedure 16.1. Create a Custom Context Mapper
- Implement the
org.switchyard.component.common.composer.ContextMapperinterface:public interface ContextMapper<T> { void mapFrom(T source, Context context) throws Exception; void mapTo(Context context, T target) throws Exception; } - Specify your implementation in your
switchyard.xmlfile:<binding.xyz ...> <contextMapper class="com.example.MyContextMapper"/> </binding.xyz> - Alternatively, you can implement the
org.switchyard.component.common.composer.RegexContextMapperinterface, which adds regular expression support:public interface RegexContextMapper<T> extends ContextMapper<T> { ContextMapper<T> setIncludes(String includes); ContextMapper<T> setExcludes(String excludes); ContextMapper<T> setIncludeNamespaces(String includeNamespaces); ContextMapper<T> setExcludeNamespaces(String excludeNamespaces); boolean matches(String name); boolean matches(QName qname); }

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.