This page last changed on Oct 11, 2006 by jesper.

Transformers are used to convert inbound data to an object type required by the UMO Component or outbound to an object type required by the transport such as a JmsMessage. Transformers can be configured on Endpoints that receive data to ensure that the expected object type is always received by an UMO Component. Transformers configured on an Outbound endpoint ensure that the endpoint receives the the correct object type before dispatching the event. Multiple transformers can be chained together to allow for finer grained transformer implementations that are easier to reuse. To configure an Endpoint to use more than one transformer, just specify a space separated list of transformers in the config file (see the configuration guide) or programmatically chain the transformers together using the setTransformer() method on the transformer.
For example an inbound transformer may look like -


Cannot resolve external resource into attachment.

And an outbound transformer might look like -


Cannot resolve external resource into attachment.

All Mule transformers must implement org.mule.transformer.UMOTransformer. There is an abstract transformer implementation that defines methods for controlling the object types this transformer supports and validates the expected return type, leaving the developer to implement a single transform() method.

Standard Transformers

Below are a list of standard transformers for Mule. Individual transports may also have their own transformer types and these will be documented in the Transports Guide.

Xml

These transformers can be found in the org.mule.transformers.xml package.

XmlToObject <-> ObjectToXml
Xml to Java Object and back again using XStream.

XSLT
Transform Xml payloads using XSL.

DomToXml <-> XmlToDom
Convert between dom objects and Xml.

JXPath
Query and extract Object graphs using XPath expressions.

Scripting
Transform objects using scripting, e.g. JavaScript or Groovy scripts.

Encryption

These transformers can be found in the org.mule.transformers.encryption package.

Encryption <-> Decryption
A pair of transformers that will use a configured UMOEncrpytionStrategy implementation to Encrypt and Decrypt data.

Compression

These transformers can be found in the org.mule.transformers.compression package and do not require any special configuration.

GZipCompress <-> GZipUncompress
A pair of transformers that can compress and uncompress data.

Encoding

These transformers can be found in the org.mule.transformers.codec package and do not require any special configuration.

SGMLEntityEncoder <-> SGMLEntityDecoder
Convert to and from SGML entity encoding.

Base64Encoder <-> Base64Decoder

UUEncoder <-> UUDecoder

UCEncoder <-> UCDecoder

Object

These transformers can be found in the org.mule.transformers.simple package and do not require any special configuration.

ByteArrayToSerializable <-> SerializableToByteArray
Serialize and deserialize objects.

StringToByteArray <-> ByteArrayToString
Convert between strings and byte arrays.

Document generated by Confluence on Nov 27, 2006 10:27