| 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 Fields |
From class
org.mule.transformer.AbstractTransformer
|
| Protected Methods |
|
Object
|
doTransform(Object src, String enc)
|
|
[Expand]
Inherited Methods |
From class
org.mule.transformer.AbstractTransformer
|
From class
java.lang.Object
|
Object
|
clone()
|
|
boolean
|
equals(Object arg0)
|
|
void
|
finalize()
|
|
final
Class<?>
|
getClass()
|
|
int
|
hashCode()
|
|
final
void
|
notify()
|
|
final
void
|
notifyAll()
|
|
String
|
toString()
|
|
final
void
|
wait()
|
|
final
void
|
wait(long arg0, int arg1)
|
|
final
void
|
wait(long arg0)
|
|
From interface
org.mule.api.AnnotatedObject
|
abstract
Object
|
getAnnotation(QName arg0)
|
|
abstract
Map<QName, Object>
|
getAnnotations()
|
|
abstract
void
|
setAnnotations(Map<QName, Object> arg0)
|
|
From interface
org.mule.api.NameableObject
|
abstract
void
|
setName(String arg0)
|
|
From interface
org.mule.api.NamedObject
|
abstract
String
|
getName()
|
|
From interface
org.mule.api.context.MuleContextAware
|
abstract
void
|
setMuleContext(MuleContext arg0)
|
|
From interface
org.mule.api.context.notification.ServerNotificationListener
|
abstract
void
|
onNotification(T arg0)
|
|
From interface
org.mule.api.lifecycle.Disposable
|
From interface
org.mule.api.lifecycle.Initialisable
|
abstract
void
|
initialise()
|
|
From interface
org.mule.api.processor.MessageProcessor
|
abstract
MuleEvent
|
process(MuleEvent arg0)
|
|
From interface
org.mule.api.transformer.Transformer
|
From interface
org.mule.endpoint.EndpointAware
|
abstract
void
|
setEndpoint(ImmutableEndpoint arg0)
|
|
Fields
Public Constructors
public
MappingTransformer
()
Public Methods
public
List<Mapping>
getMappings
()
public
void
setMappings
(List<Mapping> mappings)
Protected Methods
protected
Object
doTransform
(Object src, String enc)