Class ArrayPathElement
- java.lang.Object
-
- com.bazaarvoice.jolt.common.pathelement.BasePathElement
-
- com.bazaarvoice.jolt.common.pathelement.ArrayPathElement
-
- All Implemented Interfaces:
EvaluatablePathElement,MatchablePathElement,PathElement
public class ArrayPathElement extends BasePathElement implements MatchablePathElement, EvaluatablePathElement
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classArrayPathElement.ArrayPathType
-
Field Summary
Fields Modifier and Type Field Description private java.lang.StringarrayIndexprivate ArrayPathElement.ArrayPathTypearrayPathTypeprivate java.lang.StringcanonicalFormprivate PathReferencerefprivate TransposePathElementtransposePathElement
-
Constructor Summary
Constructors Constructor Description ArrayPathElement(java.lang.String key)
-
Method Summary
All Methods Static 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.java.lang.IntegergetExplicitArrayIndex()booleanisExplicitArrayIndex()MatchedElementmatch(java.lang.String dataKey, WalkedPath walkedPath)See if this PathElement matches the given dataKey.private static java.lang.StringverifyStringIsNonNegativeInteger(java.lang.String key)-
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
-
-
-
-
Field Detail
-
arrayPathType
private final ArrayPathElement.ArrayPathType arrayPathType
-
ref
private final PathReference ref
-
transposePathElement
private final TransposePathElement transposePathElement
-
canonicalForm
private final java.lang.String canonicalForm
-
arrayIndex
private final java.lang.String arrayIndex
-
-
Method Detail
-
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
-
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
-
verifyStringIsNonNegativeInteger
private static java.lang.String verifyStringIsNonNegativeInteger(java.lang.String key)
- Returns:
- the String version of a non-Negative integer, else null
-
getExplicitArrayIndex
public java.lang.Integer getExplicitArrayIndex()
-
isExplicitArrayIndex
public boolean isExplicitArrayIndex()
-
match
public MatchedElement match(java.lang.String dataKey, WalkedPath walkedPath)
Description copied from interface:MatchablePathElementSee if this PathElement matches the given dataKey. If it does not match, this method returns null. If this PathElement does match, it returns a LiteralPathElement with subKeys filled in.- Specified by:
matchin interfaceMatchablePathElement- Parameters:
dataKey- String key value from the input datawalkedPath- "up the tree" list of LiteralPathElements, that may be used by this key as it is computing its match- Returns:
- null or a matched LiteralPathElement
-
-