Class StarDoublePathElement
java.lang.Object
com.bazaarvoice.jolt.common.pathelement.BasePathElement
com.bazaarvoice.jolt.common.pathelement.StarDoublePathElement
- All Implemented Interfaces:
MatchablePathElement,PathElement,StarPathElement
PathElement for the a double "*" wildcard such as tag-*-*. In this case we can avoid doing any
regex work by doing String begins, ends and mid element exists.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intfinMidIndex(String literal) The assumption here is: * means 1 or more characters.Get the canonical form of this PathElement.match(String dataKey, WalkedPath walkedPath) See if this PathElement matches the given dataKey.booleanstringMatch(String literal) Method to see if a candidate key would match this PathElement.Methods inherited from class com.bazaarvoice.jolt.common.pathelement.BasePathElement
getRawKey, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.bazaarvoice.jolt.common.pathelement.PathElement
getRawKey
-
Field Details
-
prefix
-
suffix
-
mid
-
-
Constructor Details
-
StarDoublePathElement
+- Parameters:
key- : should be a String with two "*" elements.
-
-
Method Details
-
stringMatch
Description copied from interface:StarPathElementMethod to see if a candidate key would match this PathElement.- Specified by:
stringMatchin interfaceStarPathElement- Parameters:
literal- test to see if the provided string will match this Element's regex- Returns:
- true if the provided literal will match this Element's regex
-
finMidIndex
The assumption here is: * means 1 or more characters. So, if we can find the mid 1 char after the prefix ends and 1 char before the suffix starts, we have found a mid match. Also, it will be the first occurrence of the mid in the literal, so we are not 'greedy' to capture as much as in the '*' -
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
-
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
-