public class WriterMessageAdapter extends AbstractMessageAdapter
WriterMessageAdapter
wraps a java.io.StringWriter and allows meta
information to be associated with the Writer.ThreadSafeAccess.AccessControl
attachments, encoding, exceptionPayload, id, logger, properties
READ, WRITE
Modifier | Constructor and Description |
---|---|
|
WriterMessageAdapter(Object message) |
protected |
WriterMessageAdapter(WriterMessageAdapter template) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
flush() |
Object |
getPayload() |
byte[] |
getPayloadAsBytes()
Converts the message implementation into a String representation
|
String |
getPayloadAsString(String encoding)
Converts the message implementation into a String representation
|
Writer |
getWriter() |
ThreadSafeAccess |
newThreadCopy() |
void |
write(String string) |
void |
write(String string,
int offset,
int len) |
addAttachment, addInboundProperties, addProperties, addProperties, assertAccess, clearProperties, getAttachment, getAttachmentNames, getBooleanProperty, getCorrelationGroupSize, getCorrelationId, getCorrelationSequence, getDoubleProperty, getEncoding, getExceptionPayload, getIntProperty, getLongProperty, getProperty, getProperty, getPropertyNames, getReplyTo, getStringProperty, getUniqueId, isDisabled, newException, release, removeAttachment, removeProperty, resetAccessControl, setBooleanProperty, setCorrelationGroupSize, setCorrelationId, setCorrelationSequence, setDoubleProperty, setEncoding, setExceptionPayload, setIntProperty, setLongProperty, setProperty, setProperty, setReplyTo, setStringProperty, toString
public WriterMessageAdapter(Object message) throws MessageTypeNotSupportedException
MessageTypeNotSupportedException
protected WriterMessageAdapter(WriterMessageAdapter template)
public String getPayloadAsString(String encoding) throws Exception
encoding
- The encoding to use when transforming the message (if
necessary). The parameter is used when converting from a byte arrayException
- Implementation may throw an endpoint specific exceptionpublic byte[] getPayloadAsBytes() throws Exception
Exception
- Implemetation may throw an endpoint specific exceptionpublic Object getPayload()
public void write(String string)
public void write(String string, int offset, int len)
public Writer getWriter()
public void flush()
public void close() throws IOException
IOException
public ThreadSafeAccess newThreadCopy()
AbstractMessageAdapter
newThreadCopy
in interface ThreadSafeAccess
newThreadCopy
in class AbstractMessageAdapter
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.