Transformers can be applied to message data as it is passed between endpoints and their associated router component. The most common use of transformers is converting the message stream used in message mode to and from a String.
The transformers element wraps one or more transformer elements. The transformer element defines a transformer that can later be attached to an endpoint. The transformer element is an empty element that has two attributes: name and className. These attributes are described in Table 5.1, “Attributes of the transformer Element”.
Example 5.3, “Message Stream Transformer Definitions” shows a common transformer definition. It defines the two transformers used by the router to transform the message stream used in message mode to a String and back into a message stream.
Example 5.3. Message Stream Transformer Definitions
<transformers>
<transformer name="InputStreamToString"
className="com.iona.cxf.router.mule.transformers.InputStreamToString" />
<transformer name="StringToInputString"
className="com.iona.cxf.router.mule.transformers.StringToInputStream" />
</transformers>