Class MailToStringTransformer
java.lang.Object
org.springframework.integration.mail.transformer.AbstractMailMessageTransformer<String>
org.springframework.integration.mail.transformer.MailToStringTransformer
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.integration.transformer.GenericTransformer<org.springframework.messaging.Message<?>,,org.springframework.messaging.Message<?>> org.springframework.integration.transformer.Transformer
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 Part or Multipart, a String will be created from an output stream of
bytes using the provided charset (or UTF-8 by default).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.springframework.integration.support.AbstractIntegrationMessageBuilder<String>doTransform(jakarta.mail.Message mailMessage) voidsetCharset(String charset) Specify the name of the Charset to use when converting from bytes.Methods inherited from class org.springframework.integration.mail.transformer.AbstractMailMessageTransformer
getMessageBuilderFactory, setBeanFactory, transform
-
Constructor Details
-
MailToStringTransformer
public MailToStringTransformer()
-
-
Method Details
-
setCharset
Specify the name of the Charset to use when converting from bytes. The default is UTF-8.- Parameters:
charset- The charset.
-
doTransform
protected org.springframework.integration.support.AbstractIntegrationMessageBuilder<String> doTransform(jakarta.mail.Message mailMessage) throws Exception - Specified by:
doTransformin classAbstractMailMessageTransformer<String>- Throws:
Exception
-