Package com.bazaarvoice.jolt.shiftr.spec
Class ShiftrSpec
- java.lang.Object
-
- com.bazaarvoice.jolt.shiftr.spec.ShiftrSpec
-
- All Implemented Interfaces:
BaseSpec
- Direct Known Subclasses:
ShiftrCompositeSpec
,ShiftrLeafSpec
public abstract class ShiftrSpec extends java.lang.Object implements BaseSpec
A Spec Object represents a single line from the JSON Shiftr Spec. At a minimum a single Spec has : Raw LHS spec value Some kind of PathElement (based off that raw LHS value) Additionally there are 2 distinct subclasses of the base Spec LeafSpec : where the RHS is a String or Array of Strings, that specify an write path for the data from this level in the tree CompositeSpec : where the RHS is a map of children Specs Mapping of JSON Shiftr Spec to Spec objects : { rating-*" : { // CompositeSpec with one child and a Star PathElement "&(1)" : { // CompositeSpec with one child and a Reference PathElement "foo: { // CompositeSpec with one child and a Literal PathElement "value" : "Rating-&1.value" // OutputtingSpec with a Literal PathElement and one write path } } } } The tree structure of formed by the CompositeSpecs is what is used during Shiftr transforms to do the parallel tree walk with the input data tree. During the parallel tree walk a stack of data (a WalkedPath) is maintained, and used when a tree walk encounters an Outputting spec to evaluate the wildcards in the write DotNotationPath.
-
-
Field Summary
Fields Modifier and Type Field Description protected MatchablePathElement
pathElement
-
Constructor Summary
Constructors Constructor Description ShiftrSpec(java.lang.String rawJsonKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MatchablePathElement
getPathElement()
Gimme the LHS path element
-
-
-
Field Detail
-
pathElement
protected final MatchablePathElement pathElement
-
-
Method Detail
-
getPathElement
public MatchablePathElement getPathElement()
Description copied from interface:BaseSpec
Gimme the LHS path element- Specified by:
getPathElement
in interfaceBaseSpec
- Returns:
- LHS path element for comparison
-
-