Spring Integration

org.springframework.integration.mail.transformer
Class MailToStringTransformer

java.lang.Object
  extended by org.springframework.integration.mail.transformer.AbstractMailMessageTransformer<java.lang.String>
      extended by org.springframework.integration.mail.transformer.MailToStringTransformer
All Implemented Interfaces:
Transformer

public class MailToStringTransformer
extends AbstractMailMessageTransformer<java.lang.String>

Transforms a Message payload of type Message to a String. If the mail message's content is a String, it will be the payload of the result Message. If the content is a Multipart, a String will be created from an output stream of bytes using the provided charset (or UTF-8 by default).

Author:
Mark Fisher

Field Summary
 
Fields inherited from class org.springframework.integration.mail.transformer.AbstractMailMessageTransformer
logger
 
Constructor Summary
MailToStringTransformer()
           
 
Method Summary
protected  MessageBuilder<java.lang.String> doTransform(javax.mail.Message mailMessage)
           
 void setCharset(java.lang.String charset)
          Specify the name of the Charset to use when converting from bytes.
 
Methods inherited from class org.springframework.integration.mail.transformer.AbstractMailMessageTransformer
transform
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailToStringTransformer

public MailToStringTransformer()
Method Detail

setCharset

public void setCharset(java.lang.String charset)
Specify the name of the Charset to use when converting from bytes. The default is UTF-8.


doTransform

protected MessageBuilder<java.lang.String> doTransform(javax.mail.Message mailMessage)
                                                throws java.lang.Exception
Specified by:
doTransform in class AbstractMailMessageTransformer<java.lang.String>
Throws:
java.lang.Exception

Spring Integration