public class WriterMessageAdapter extends AbstractMessageAdapter
WriterMessageAdapter wraps a java.io.StringWriter and allows meta
information to be associated with the Writer.ThreadSafeAccess.AccessControlattachments, encoding, exceptionPayload, id, logger, propertiesREAD, 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, toStringpublic WriterMessageAdapter(Object message) throws MessageTypeNotSupportedException
MessageTypeNotSupportedExceptionprotected 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
IOExceptionpublic ThreadSafeAccess newThreadCopy()
AbstractMessageAdapternewThreadCopy in interface ThreadSafeAccessnewThreadCopy in class AbstractMessageAdapterCopyright © 2003-2012 MuleSource, Inc.. All Rights Reserved.