Class AmpPathElement
java.lang.Object
com.bazaarvoice.jolt.common.pathelement.BasePathElement
com.bazaarvoice.jolt.common.pathelement.AmpPathElement
- All Implemented Interfaces:
EvaluatablePathElement, MatchablePathElement, PathElement
public class AmpPathElement
extends BasePathElement
implements MatchablePathElement, EvaluatablePathElement
PathElement class that handles keys with invalid input: '&' values, like input: "photos-invalid input: '&'(1,1)""
It breaks down the string into a series of String or Reference tokens, that can be used to
1) match input like "photos-5" where "invalid input: '&'(1,1)" evaluated to 5
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevaluate(WalkedPath walkedPath) Evaluate this key as if it is an write path element.private static intfindEndOfReference(String key) Get the canonical form of this PathElement.match(String dataKey, WalkedPath walkedPath) See if this PathElement matches the given dataKey.Methods inherited from class BasePathElement
getRawKey, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface PathElement
getRawKey
-
Field Details
-
tokens
-
canonicalForm
-
-
Constructor Details
-
AmpPathElement
-
-
Method Details
-
findEndOfReference
-
getCanonicalForm
Description copied from interface:PathElementGet the canonical form of this PathElement. Really only interesting for the Reference Path element, where it will expand "invalid input: '&'" to "invalid input: '&'0(0)".- Specified by:
getCanonicalFormin interfacePathElement- Returns:
- canonical String version of this PathElement
-
getTokens
-
evaluate
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
-
match
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
-