org.mule.transport.email.transformers
Class ObjectToMimeMessage

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

public class ObjectToMimeMessage
extends StringToEmailMessage

Transforms a Message to a MuleMessage, with support for attachments


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
ObjectToMimeMessage()
           
 
Method Summary
protected  void addBodyPartHeaders(BodyPart part, String name, MuleMessage message)
           
protected  BodyPart getBodyPartForAttachment(DataHandler handler, String name)
           
protected  BodyPart getPayloadBodyPart(Object payload, String contentType)
           
protected  void setContent(Object payload, Message msg, String contentType, MuleMessage message)
           
 void setUseInboundAttachments(boolean useInboundAttachments)
          Set whether inbound attachments should be transformed into MIME parts
 void setUseOutboundAttachments(boolean useOutboundAttachments)
          Set whether outbound attachments should be transformed into MIME parts
 Object transformMessage(MuleMessage message, String outputEncoding)
          Transform the message
 
Methods inherited from class org.mule.transport.email.transformers.StringToEmailMessage
evaluate, lookupProperty
 
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

ObjectToMimeMessage

public ObjectToMimeMessage()
Method Detail

transformMessage

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

Overrides:
transformMessage in class StringToEmailMessage
Throws:
TransformerException

setContent

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

addBodyPartHeaders

protected void addBodyPartHeaders(BodyPart part,
                                  String name,
                                  MuleMessage message)

getBodyPartForAttachment

protected BodyPart getBodyPartForAttachment(DataHandler handler,
                                            String name)
                                     throws MessagingException
Throws:
MessagingException

getPayloadBodyPart

protected BodyPart getPayloadBodyPart(Object payload,
                                      String contentType)
                               throws MessagingException,
                                      TransformerException,
                                      IOException
Throws:
MessagingException
TransformerException
IOException

setUseInboundAttachments

public void setUseInboundAttachments(boolean useInboundAttachments)
Set whether inbound attachments should be transformed into MIME parts


setUseOutboundAttachments

public void setUseOutboundAttachments(boolean useOutboundAttachments)
Set whether outbound attachments should be transformed into MIME parts



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