Class BaseTraversalStep<StepType,DataType>
- java.lang.Object
-
- com.bazaarvoice.jolt.traversr.traversal.BaseTraversalStep<StepType,DataType>
-
- All Implemented Interfaces:
TraversalStep<StepType,DataType>
- Direct Known Subclasses:
ArrayTraversalStep
,MapTraversalStep
public abstract class BaseTraversalStep<StepType,DataType> extends java.lang.Object implements TraversalStep<StepType,DataType>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.bazaarvoice.jolt.traversr.traversal.TraversalStep
TraversalStep.Operation
-
-
Field Summary
Fields Modifier and Type Field Description protected TraversalStep
child
protected Traversr
traversr
-
Constructor Summary
Constructors Constructor Description BaseTraversalStep(Traversr traversr, TraversalStep child)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TraversalStep
getChild()
Optional<DataType>
traverse(StepType tree, TraversalStep.Operation op, java.util.Iterator<java.lang.String> keys, DataType data)
The meat of the Traversal.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.bazaarvoice.jolt.traversr.traversal.TraversalStep
get, getStepType, newContainer, overwriteSet, remove
-
-
-
-
Field Detail
-
child
protected final TraversalStep child
-
traversr
protected final Traversr traversr
-
-
Constructor Detail
-
BaseTraversalStep
public BaseTraversalStep(Traversr traversr, TraversalStep child)
-
-
Method Detail
-
getChild
public TraversalStep getChild()
- Specified by:
getChild
in interfaceTraversalStep<StepType,DataType>
- Returns:
- the child Traversal or null if this Traversal has no child
-
traverse
public final Optional<DataType> traverse(StepType tree, TraversalStep.Operation op, java.util.Iterator<java.lang.String> keys, DataType data)
Description copied from interface:TraversalStep
The meat of the Traversal. Pull a key from the iterator, use it to make the traversal, and then call traverse on your child Traversal.- Specified by:
traverse
in interfaceTraversalStep<StepType,DataType>
- Parameters:
tree
- tree of data to walkop
- the Operation to perform is this is the last node of the Traversalkeys
- keys to usedata
- the data to place if the operation is SET- Returns:
- if SET, null for fail or the "data" object for ok. if GET, PANTS
-
-