org.springframework.integration.stream
Class CharacterStreamWritingMessageHandler
java.lang.Object
org.springframework.integration.context.IntegrationObjectSupport
org.springframework.integration.handler.AbstractMessageHandler
org.springframework.integration.stream.CharacterStreamWritingMessageHandler
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.BeanNameAware, org.springframework.beans.factory.InitializingBean, org.springframework.core.Ordered, NamedComponent, Orderable, MessageHandler, TrackableComponent
public class CharacterStreamWritingMessageHandler
- extends AbstractMessageHandler
A 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.
- Author:
- Mark Fisher
Fields inherited from interface org.springframework.core.Ordered |
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CharacterStreamWritingMessageHandler
public CharacterStreamWritingMessageHandler(java.io.Writer writer)
CharacterStreamWritingMessageHandler
public CharacterStreamWritingMessageHandler(java.io.Writer writer,
int bufferSize)
stdout
public static CharacterStreamWritingMessageHandler stdout()
- Factory method that creates a target for stdout (System.out) with the
default charset encoding.
stdout
public static CharacterStreamWritingMessageHandler stdout(java.lang.String charsetName)
- Factory method that creates a target for stdout (System.out) with the
specified charset encoding.
stderr
public static CharacterStreamWritingMessageHandler stderr()
- Factory method that creates a target for stderr (System.err) with the
default charset encoding.
stderr
public static CharacterStreamWritingMessageHandler stderr(java.lang.String charsetName)
- Factory method that creates a target for stderr (System.err) with the
specified charset encoding.
setShouldAppendNewLine
public void setShouldAppendNewLine(boolean shouldAppendNewLine)
handleMessageInternal
protected void handleMessageInternal(Message<?> message)
- Specified by:
handleMessageInternal
in class AbstractMessageHandler