public class CharacterStreamWritingMessageHandler extends AbstractMessageHandler
MessageHandler
that writes characters to a Writer
.
String, character array, and byte array payloads will be written directly,
but for other payload types, the result of the object's IntegrationObjectSupport.toString()
method will be written. To append a new-line after each write, set the
shouldAppendNewLine
flag to 'true'. It is 'false' by default.Constructor and Description |
---|
CharacterStreamWritingMessageHandler(java.io.Writer writer) |
CharacterStreamWritingMessageHandler(java.io.Writer writer,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
protected void |
handleMessageInternal(Message<?> message) |
void |
setShouldAppendNewLine(boolean shouldAppendNewLine) |
static CharacterStreamWritingMessageHandler |
stderr()
Factory method that creates a target for stderr (System.err) with the
default charset encoding.
|
static CharacterStreamWritingMessageHandler |
stderr(java.lang.String charsetName)
Factory method that creates a target for stderr (System.err) with the
specified charset encoding.
|
static CharacterStreamWritingMessageHandler |
stdout()
Factory method that creates a target for stdout (System.out) with the
default charset encoding.
|
static CharacterStreamWritingMessageHandler |
stdout(java.lang.String charsetName)
Factory method that creates a target for stdout (System.out) with the
specified charset encoding.
|
getComponentType, getOrder, handleMessage, setOrder, setShouldTrack
afterPropertiesSet, getApplicationContextId, getBeanFactory, getComponentName, getConversionService, getIntegrationProperties, getIntegrationProperty, getTaskScheduler, onInit, setApplicationContext, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getComponentName
public CharacterStreamWritingMessageHandler(java.io.Writer writer)
public CharacterStreamWritingMessageHandler(java.io.Writer writer, int bufferSize)
public static CharacterStreamWritingMessageHandler stdout()
public static CharacterStreamWritingMessageHandler stdout(java.lang.String charsetName)
public static CharacterStreamWritingMessageHandler stderr()
public static CharacterStreamWritingMessageHandler stderr(java.lang.String charsetName)
public void setShouldAppendNewLine(boolean shouldAppendNewLine)
protected void handleMessageInternal(Message<?> message)
handleMessageInternal
in class AbstractMessageHandler