org.mule.transport.email.transformers
Class StringToEmailMessage

java.lang.Object
  extended by org.mule.transformer.AbstractTransformer
      extended by org.mule.transformer.AbstractMessageTransformer
          extended by org.mule.transport.email.transformers.StringToEmailMessage
All Implemented Interfaces:
AnnotatedObject, MuleContextAware, Disposable, Initialisable, NameableObject, NamedObject, MessageProcessor, MessageTransformer, Transformer, EndpointAware
Direct Known Subclasses:
ObjectToMimeMessage

public class StringToEmailMessage
extends AbstractMessageTransformer

StringToEmailMessage will convert a String to a JavaMail Message, using the String as the contents. This implementation uses properties on the transformer to determine the To: and Subject: fields.


Field Summary
 
Fields inherited from class org.mule.transformer.AbstractTransformer
encoding, endpoint, mimeType, MULE_MESSAGE_DATA_TYPE, muleContext, name, returnType, sourceTypes
 
Fields inherited from interface org.mule.api.lifecycle.Initialisable
PHASE_NAME
 
Fields inherited from interface org.mule.api.lifecycle.Disposable
PHASE_NAME
 
Fields inherited from interface org.mule.api.AnnotatedObject
PROPERTY_NAME
 
Constructor Summary
StringToEmailMessage()
           
 
Method Summary
 String evaluate(String value, MuleMessage message)
           
protected  String lookupProperty(MuleMessage message, String propName, String defaultValue)
          Searches in outbound, then invocation scope.
protected  void setContent(Object payload, Message msg, String contentType, MuleMessage message)
           
 Object transformMessage(MuleMessage message, String outputEncoding)
          Transform the message
 
Methods inherited from class org.mule.transformer.AbstractMessageTransformer
checkReturnClass, doTransform, isSourceDataTypeSupported, transform, transform, transform
 
Methods inherited from class org.mule.transformer.AbstractTransformer
dispose, generateTransformerName, getAnnotation, getAnnotations, getEncoding, getEncoding, getEndpoint, getMimeType, getName, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, initialise, isAcceptNull, isAllowNullReturn, isConsumed, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, isSourceTypeSupported, process, registerSourceType, registerSourceType, setAllowNullReturn, setAnnotations, setEncoding, setEndpoint, setIgnoreBadInput, setMimeType, setMuleContext, setName, setReturnClass, setReturnDataType, toString, transform, unregisterSourceType, unregisterSourceType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mule.api.transformer.Transformer
getEncoding, getEndpoint, getMimeType, getReturnClass, getReturnDataType, getSourceDataTypes, getSourceTypes, isAcceptNull, isIgnoreBadInput, isSourceDataTypeSupported, isSourceTypeSupported, setReturnClass, setReturnDataType, transform
 
Methods inherited from interface org.mule.api.processor.MessageProcessor
process
 
Methods inherited from interface org.mule.api.lifecycle.Initialisable
initialise
 
Methods inherited from interface org.mule.api.lifecycle.Disposable
dispose
 
Methods inherited from interface org.mule.api.NameableObject
setName
 
Methods inherited from interface org.mule.api.NamedObject
getName
 
Methods inherited from interface org.mule.api.context.MuleContextAware
setMuleContext
 
Methods inherited from interface org.mule.endpoint.EndpointAware
setEndpoint
 

Constructor Detail

StringToEmailMessage

public StringToEmailMessage()
Method Detail

transformMessage

public Object transformMessage(MuleMessage message,
                               String outputEncoding)
                        throws TransformerException
Description copied from class: AbstractMessageTransformer
Transform the message

Specified by:
transformMessage in class AbstractMessageTransformer
Throws:
TransformerException

lookupProperty

protected String lookupProperty(MuleMessage message,
                                String propName,
                                String defaultValue)
Searches in outbound, then invocation scope. If not found, returns a passed in default value.


evaluate

public String evaluate(String value,
                       MuleMessage message)

setContent

protected void setContent(Object payload,
                          Message msg,
                          String contentType,
                          MuleMessage message)
                   throws Exception
Throws:
Exception


Copyright © 2003-2014 MuleSoft, Inc.. All Rights Reserved.