Package com.bazaarvoice.jolt.common.tree
Class MatchedElement
- java.lang.Object
-
- com.bazaarvoice.jolt.common.pathelement.BasePathElement
-
- com.bazaarvoice.jolt.common.tree.MatchedElement
-
- All Implemented Interfaces:
EvaluatablePathElement
,PathElement
- Direct Known Subclasses:
ArrayMatchedElement
public class MatchedElement extends BasePathElement implements EvaluatablePathElement
MatchedElement is the result of a "match" between a spec PathElement and some input data. MatchedElements are not thread safe, and should instead be stack / single Thread/Transform specific. This mutability was specifically added for the the HashCount functionality, which allows Shiftr to transform data form maps to lists.
-
-
Constructor Summary
Constructors Constructor Description MatchedElement(java.lang.String key)
MatchedElement(java.lang.String key, java.util.List<java.lang.String> subKeys)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
evaluate(WalkedPath walkedPath)
Evaluate this key as if it is an write path element.java.lang.String
getCanonicalForm()
Get the canonical form of this PathElement.int
getHashCount()
int
getSubKeyCount()
java.lang.String
getSubKeyRef(int index)
void
incrementHashCount()
Here be mutability...-
Methods inherited from class com.bazaarvoice.jolt.common.pathelement.BasePathElement
getRawKey, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.bazaarvoice.jolt.common.pathelement.PathElement
getRawKey
-
-
-
-
Method Detail
-
evaluate
public java.lang.String evaluate(WalkedPath walkedPath)
Description copied from interface:EvaluatablePathElement
Evaluate this key as if it is an write path element.- Specified by:
evaluate
in interfaceEvaluatablePathElement
- Parameters:
walkedPath
- "up the tree" list of LiteralPathElements, that may be used by this key as it is computing- Returns:
- String path element to use for write tree building
-
getCanonicalForm
public java.lang.String getCanonicalForm()
Description copied from interface:PathElement
Get the canonical form of this PathElement. Really only interesting for the Reference Path element, where it will expand "&" to "&0(0)".- Specified by:
getCanonicalForm
in interfacePathElement
- Returns:
- canonical String version of this PathElement
-
getSubKeyRef
public java.lang.String getSubKeyRef(int index)
-
getSubKeyCount
public int getSubKeyCount()
-
getHashCount
public int getHashCount()
-
incrementHashCount
public void incrementHashCount()
Here be mutability...
-
-