public class

MappingTransformer

extends AbstractTransformer
java.lang.Object
   ↳ org.mule.transformer.AbstractTransformer
     ↳ org.mule.module.datapack.MappingTransformer

Class Overview

A transformer for converting data and structure held in a list of Maps. Many projects that work with tabular data will use a List of java.util.Map objects where each map is a row. In Mule the JDBC, Salesforce, Datapack and HL7 connectors all use this format. This transformer allows simple mapping rules to be created to alter these list of maps. The transformer will still return a list of maps but the number of fields, field names and vlaue can be changed. For example, for simple one-to-one field mapping it can be used as: or to combine fields an expression can be used: If sourceColumn is defined it will override anything set in the 'value' attribute. You can also set a static default value for a field. Note when defining mapping rules it is don in the context of what you want the destination data to look like. As such, you need to specify a rule for every field you want in the resulting data set. each mapping rule will be applied to very row (map) in the data set.

Summary

[Expand]
Inherited Constants
From interface org.mule.api.AnnotatedObject
From interface org.mule.api.lifecycle.Disposable
From interface org.mule.api.lifecycle.Initialisable
Fields
private List<Mapping> mappings
[Expand]
Inherited Fields
From class org.mule.transformer.AbstractTransformer
Public Constructors
MappingTransformer()
Public Methods
List<Mapping> getMappings()
void setMappings(List<Mapping> mappings)
Protected Methods
Object doTransform(Object src, String enc)
[Expand]
Inherited Methods
From class org.mule.transformer.AbstractTransformer
From class java.lang.Object
From interface org.mule.api.AnnotatedObject
From interface org.mule.api.NameableObject
From interface org.mule.api.NamedObject
From interface org.mule.api.context.MuleContextAware
From interface org.mule.api.context.notification.ServerNotificationListener
From interface org.mule.api.lifecycle.Disposable
From interface org.mule.api.lifecycle.Initialisable
From interface org.mule.api.processor.MessageProcessor
From interface org.mule.api.transformer.Transformer
From interface org.mule.endpoint.EndpointAware

Fields

private List<Mapping> mappings

Public Constructors

public MappingTransformer ()

Public Methods

public List<Mapping> getMappings ()

public void setMappings (List<Mapping> mappings)

Parameters
mappings

Protected Methods

protected Object doTransform (Object src, String enc)

Parameters
src
enc
Throws
TransformerException