此内容没有您所选择的语言版本。
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); }