@VisitAfterIf(condition="!parameters.containsKey(\'visitBefore\') || parameters.visitBefore.value != \'true\'") @VisitBeforeIf(condition="!parameters.containsKey(\'visitAfter\') || parameters.visitAfter.value != \'true\'") public class OutputStreamRouter extends Object implements DOMElementVisitor, SAXVisitBefore, SAXVisitAfter, Consumer
BeanContext
beans) an OutputStream.
An OutputStreamRouter is used in combination with a concreate implementation of
AbstractOutputStreamResource
, for example a FileOutputStreamResource
.
Example configuration:
<resource-config selector="orderItem"> <resource>org.milyn.routing.io.OutputStreamRouter</resource> <param name="resourceName">refToResource</param> <param name="beanId">orderItem</param> </resource-config>Description of configuration properties:
beanId
is key used search the execution context for the content to be written the OutputStream
resourceName
is a reference to a previously configured AbstractOutputStreamResource
encoding
is the encoding used when writing a characters to file
Constructor and Description |
---|
OutputStreamRouter() |
Modifier and Type | Method and Description |
---|---|
boolean |
consumes(Object object)
Does this consumer consume the specified named object.
|
String |
getResourceName() |
void |
initialize() |
void |
visitAfter(Element element,
ExecutionContext executionContext)
Visit the supplied element after visiting its child elements.
|
void |
visitAfter(SAXElement element,
ExecutionContext executionContext)
Visit the supplied element after visiting its child elements.
|
void |
visitBefore(Element element,
ExecutionContext executionContext)
Visit the supplied element before visiting its child elements.
|
void |
visitBefore(SAXElement element,
ExecutionContext executionContext)
Visit the supplied element before visiting its child elements.
|
@Initialize public void initialize() throws SmooksConfigurationException
SmooksConfigurationException
public boolean consumes(Object object)
Consumer
Producer
that is executing
on the same element. The consumer should only return false
if it knows for
certain that it doesn't consumer the specified named object. If uncertain, it should
error on the side of saying that it does consume the object.public void visitBefore(Element element, ExecutionContext executionContext) throws SmooksException
DOMVisitBefore
visitBefore
in interface DOMVisitBefore
element
- The DOM element being visited.executionContext
- Request relative instance.SmooksException
- Element processing failure.public void visitAfter(Element element, ExecutionContext executionContext) throws SmooksException
DOMVisitAfter
visitAfter
in interface DOMVisitAfter
element
- The DOM element being visited.executionContext
- Request relative instance.SmooksException
- Element processing failure.public void visitBefore(SAXElement element, ExecutionContext executionContext) throws SmooksException, IOException
SAXVisitBefore
visitBefore
in interface SAXVisitBefore
element
- The SAX element being visited.executionContext
- Execution context.SmooksException
- Event processing failure.IOException
- Error writing event to output writer.public void visitAfter(SAXElement element, ExecutionContext executionContext) throws SmooksException, IOException
SAXVisitAfter
visitAfter
in interface SAXVisitAfter
element
- The SAX element being visited.executionContext
- Execution context.SmooksException
- Event processing failure.IOException
- Error writing event to output writer.public String getResourceName()
Copyright © 2020. All rights reserved.