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.Stringevaluate(WalkedPath walkedPath)Evaluate this key as if it is an write path element.java.lang.StringgetCanonicalForm()Get the canonical form of this PathElement.intgetHashCount()intgetSubKeyCount()java.lang.StringgetSubKeyRef(int index)voidincrementHashCount()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:EvaluatablePathElementEvaluate this key as if it is an write path element.- Specified by:
evaluatein 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:PathElementGet the canonical form of this PathElement. Really only interesting for the Reference Path element, where it will expand "&" to "&0(0)".- Specified by:
getCanonicalFormin 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...
-
-