Class ElementPositionCounter
- java.lang.Object
-
- org.smooks.engine.resource.config.xpath.ElementPositionCounter
-
- All Implemented Interfaces:
ContentHandler
,BeforeVisitor
,SaxNgVisitor
,Visitor
public class ElementPositionCounter extends Object implements BeforeVisitor
Element position counter. Used for position based XPath predicates.- Author:
- tom.fennelly@jboss.com
-
-
Constructor Summary
Constructors Constructor Description ElementPositionCounter(SelectorStep selectorStep)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getCount(Element element, ExecutionContext executionContext)
protected Integer
getElementPosition(Element element, ExecutionContext executionContext)
SelectorStep
getSelectorStep()
void
visitBefore(Element element, ExecutionContext executionContext)
Visits the beginning of anElement
.
-
-
-
Constructor Detail
-
ElementPositionCounter
public ElementPositionCounter(SelectorStep selectorStep)
-
-
Method Detail
-
getSelectorStep
public SelectorStep getSelectorStep()
-
visitBefore
public void visitBefore(Element element, ExecutionContext executionContext) throws SmooksException
Description copied from interface:BeforeVisitor
Visits the beginning of anElement
.- Specified by:
visitBefore
in interfaceBeforeVisitor
- Parameters:
element
- theElement
representing the beginning of the fragment. TheElement
's ancestors are traversable unless the global configuration parametermaintain.element.stack
is set to false. TheElement
's child nodes are not traversable.executionContext
- the currentExecutionContext
- Throws:
SmooksException
-
getCount
public int getCount(Element element, ExecutionContext executionContext)
-
getElementPosition
protected Integer getElementPosition(Element element, ExecutionContext executionContext)
-
-