org.janux.bus.processor
Class StringProcessorAbstract
java.lang.Object
org.janux.bus.processor.StringProcessorAbstract
- All Implemented Interfaces:
- Processor, StringProcessor
public abstract class StringProcessorAbstract
- extends Object
- implements StringProcessor
Abstract base implementation of SpringProcessor that implements a template method for the
inherited method Processor.process(InputStream, OutputStream)
that converts the
InputStream into a String, processes the String, and writes the processed String into the
OutputStream; sub-classes should provide an implementation of the
StringProcessor.process(String)
method.
Optionally, implementing classes can specify different Charsets
for respectively
decoding/encoding the Input/Output streams. If either is null, the default character set for the
system would be used for either decoding or encoding, respectively.
- Since:
- version 0.2.03 - Jun 20, 2007
- Author:
- Philippe Paravicini
- See Also:
StringProcessor
,
Processor
Field Summary |
protected org.apache.commons.logging.Log |
log
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
protected transient org.apache.commons.logging.Log log
StringProcessorAbstract
public StringProcessorAbstract()
getIncomingCharset
public Charset getIncomingCharset()
- Returns:
- Returns the charset in which to decode the input.
getOutgoingCharset
public Charset getOutgoingCharset()
- Returns:
- Returns the charset in which to encode the output.
process
public abstract String process(String in)
- Derived classes should implement this method only
- Specified by:
process
in interface StringProcessor
process
public void process(InputStream in,
OutputStream out)
- Template method that transforms the InputStream into a String, calls
this.process(String) and writes the resulting response to the OutputStream
TODO: This default template method has not been tested, use at your own risk
- Specified by:
process
in interface Processor
Copyright © 2005-2013 Janux. All Rights Reserved.