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:
- BeanFactoryAware, BeanNameAware, InitializingBean, Ordered, NamedComponent, 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
Methods inherited from class org.springframework.integration.context.IntegrationObjectSupport |
afterPropertiesSet, getBeanFactory, getComponentName, getConversionService, getRequiredMetadataPersister, getTaskScheduler, onInit, setBeanFactory, setBeanName, setComponentName, setConversionService, setTaskScheduler, toString |
CharacterStreamWritingMessageHandler
public CharacterStreamWritingMessageHandler(Writer writer)
CharacterStreamWritingMessageHandler
public CharacterStreamWritingMessageHandler(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(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(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
Copyright © 2010. All Rights Reserved.