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
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
"invalid input: '&'(1)" : { // CompositeSpec with one child and a Reference PathElement
"foo: { // CompositeSpec with one child and a Literal PathElement
"value" : "Rating-invalid input: '&'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 Details
-
pathElement
-
-
Constructor Details
-
ShiftrSpec
-
-
Method Details
-
getPathElement
Description copied from interface:BaseSpec
Gimme the LHS path element- Specified by:
getPathElement
in interfaceBaseSpec
- Returns:
- LHS path element for comparison
-