org.mule.transformer.simple
Class AutoTransformer

java.lang.Object
  extended by org.mule.transformer.AbstractTransformer
      extended by org.mule.transformer.AbstractMessageAwareTransformer
          extended by org.mule.transformer.simple.AutoTransformer
All Implemented Interfaces:
Initialisable, NamedObject, BaseTransformer, Transformer

public class AutoTransformer
extends AbstractMessageAwareTransformer

A transformer that uses the transform discovery mechanism to convert the message payload. This transformer works much better when transforming custom object types rather that java types since there is less chance for ambiguity. If an exact match cannot be made an execption will be thrown.


Field Summary
 
Fields inherited from class org.mule.transformer.AbstractTransformer
DEFAULT_TRUNCATE_LENGTH, endpoint, logger, name, returnClass, sourceTypes
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Constructor Summary
AutoTransformer()
           
 
Method Summary
 void initialise()
          Template method where deriving classes can do any initialisation after the properties have been set on this transformer
 Object transform(MuleMessage message, String outputEncoding)
           
 
Methods inherited from class org.mule.transformer.AbstractMessageAwareTransformer
doTransform, isSourceTypeSupported
 
Methods inherited from class org.mule.transformer.AbstractTransformer
checkReturnClass, generateTransformerName, getEndpoint, getName, getReturnClass, getSourceTypes, isAcceptNull, isConsumed, isIgnoreBadInput, isSourceTypeSupported, registerSourceType, setEndpoint, setIgnoreBadInput, setName, setReturnClass, toString, transform, unregisterSourceType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AutoTransformer

public AutoTransformer()
Method Detail

initialise

public void initialise()
                throws InitialisationException
Template method where deriving classes can do any initialisation after the properties have been set on this transformer

Specified by:
initialise in interface Initialisable
Overrides:
initialise in class AbstractTransformer
Throws:
InitialisationException
RecoverableException - if an error occurs that can be recovered from

transform

public Object transform(MuleMessage message,
                        String outputEncoding)
                 throws TransformerException
Specified by:
transform in class AbstractMessageAwareTransformer
Throws:
TransformerException


Copyright © 2003-2009 MuleSource, Inc.. All Rights Reserved.