com.bazaarvoice.jolt.traversr.traversal
public interface TraversalStep<T>
| Modifier and Type | Interface and Description |
|---|---|
static class |
TraversalStep.Operation
The three things you can do with a Traversal.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
get(T tree,
String key)
Return the data for the key from the provided tree object.
|
TraversalStep |
getChild() |
Class<?> |
getStepType()
Return the Class of the Generic T, so that it can be used in an
"instanceof" style check.
|
Object |
newContainer()
Create a new mutable Map or List, suitable for this PathElement to traverse.
|
Object |
overwriteSet(T tree,
String key,
Object data)
Insert the data into the tree, overwriting any data that is there.
|
Object |
remove(T tree,
String key)
Remove and return the data for the key from the provided tree object.
|
Object |
traverse(Object tree,
TraversalStep.Operation op,
Iterator<String> keys,
Object data)
The meat of the Traversal.
|
Object get(T tree, String key)
Object remove(T tree, String key)
Object overwriteSet(T tree, String key, Object data)
TraversalStep getChild()
Object newContainer()
Class<?> getStepType()
Object traverse(Object tree, TraversalStep.Operation op, Iterator<String> keys, Object data)
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 SETCopyright © 2014. All Rights Reserved.