@VisitBeforeIf(condition="!parameters.containsKey(\'executeAfter\') || parameters.executeAfter.value != \'true\'") @VisitAfterIf(condition="parameters.containsKey(\'executeAfter\') && parameters.executeAfter.value == \'true\'") public class Counter extends Object implements SAXVisitBefore, SAXVisitAfter, DOMVisitBefore, DOMVisitAfter, Producer
http://www.milyn.org/xsd/smooks/calc-1.1.xsd
for more
information.
Example basic configuration:
<resource-config selector="orderItems"> <resource>org.milyn.calc.Counter</resource> <param name="beanId">count</param> </resource-config> Optional parameters: <param name="start">1</param> <param name="amount">2</param> <param name="amountExpression">incrementAmount</param> <param name="startExpression">startValue</param> <param name="resetCondition">count == 10</param> <param name="direction">DECREMENT</param> <param name="executeAfter>false</param>Description of configuration properties:
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_AMOUNT |
static Long |
DEFAULT_START_INDEX |
Constructor and Description |
---|
Counter() |
Modifier and Type | Method and Description |
---|---|
void |
count(ExecutionContext executionContext,
Fragment source) |
Set<? extends Object> |
getProducts()
Get the set of products produced by this producer instance.
|
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.
|
public static final Long DEFAULT_START_INDEX
public static final int DEFAULT_AMOUNT
@Initialize public void initialize()
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 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 count(ExecutionContext executionContext, Fragment source)
public Set<? extends Object> getProducts()
Producer
getProducts
in interface Producer
Copyright © 2020. All rights reserved.