Package com.bazaarvoice.jolt.common
Class SpecStringParser
java.lang.Object
com.bazaarvoice.jolt.common.SpecStringParser
Static utility methods for handling specStrings such that we can process them into
usable formats for further processing into PathElement objects
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
fixLeadingBracketSugar
(String dotNotaton) Given a dotNotation style outputPath like "data[2].invalid input: '&'(1,1)", this method fixes the syntactic sugar of "data[2]" --> "data.[2]" This makes all the rest of the String processing easier once we know that we can always split on the '.' character.static String
parseAtPathElement
(Iterator<Character> iter, String dotNotationRef) Parse RHS Transpose @ logic.Method that recursively parses a dotNotation String based on an iterator.parseFunctionArgs
(String argString) static String
removeEscapeChars
(String origKey) static String
removeEscapedValues
(String origKey) stringIterator
(String string) Helper method to turn a String into an Iterator
-
Constructor Details
-
SpecStringParser
private SpecStringParser()
-
-
Method Details
-
parseDotNotation
public static List<String> parseDotNotation(List<String> pathStrings, Iterator<Character> iter, String dotNotationRef) Method that recursively parses a dotNotation String based on an iterator. This method will call out to parseAtPathElement- Parameters:
pathStrings
- List to store parsed Strings that each represent a PathElementiter
- the iterator to pull characters fromdotNotationRef
- the original dotNotation string used for error messages- Returns:
- evaluated List
from dot notation string spec
-
stringIterator
Helper method to turn a String into an Iterator -
fixLeadingBracketSugar
Given a dotNotation style outputPath like "data[2].invalid input: '&'(1,1)", this method fixes the syntactic sugar of "data[2]" --> "data.[2]" This makes all the rest of the String processing easier once we know that we can always split on the '.' character.- Parameters:
dotNotaton
- Output path dot notation- Returns:
-
parseAtPathElement
Parse RHS Transpose @ logic. "@(a.b)" --> pulls "(a.b)" off the iterator "@a.b" --> pulls just "a" off the iterator This method expects that the the '@' character has already been seen.- Parameters:
iter
- iterator to pull data fromdotNotationRef
- the original dotNotation string used for error messages
-
removeEscapedValues
-
removeEscapeChars
-
parseFunctionArgs
-