Package com.bazaarvoice.jolt.cardinality
Class CardinalityCompositeSpec
java.lang.Object
com.bazaarvoice.jolt.cardinality.CardinalitySpec
com.bazaarvoice.jolt.cardinality.CardinalityCompositeSpec
- All Implemented Interfaces:
BaseSpec
CardinalitySpec that has children, which it builds and then manages during Transforms.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<CardinalitySpec> private static final ComputedKeysComparator
private final Map
<String, CardinalitySpec> private CardinalityLeafSpec
Fields inherited from class com.bazaarvoice.jolt.cardinality.CardinalitySpec
pathElement
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
applyCardinality
(String inputKey, Object input, WalkedPath walkedPath, Object parentContainer) If this Spec matches the inputkey, then perform one step in the parallel treewalk.private static void
applyKeyToLiteralAndComputed
(CardinalityCompositeSpec spec, String subKeyStr, Object subInput, WalkedPath walkedPath, Object input) This method implements the Cardinality matching behavior when we have both literal and computed children.private static List
<CardinalitySpec> createChildren
(Map<String, Object> rawSpec) Recursively walk the spec input tree.private void
process
(Object input, WalkedPath walkedPath) Methods inherited from class com.bazaarvoice.jolt.cardinality.CardinalitySpec
apply, getPathElement, parse
-
Field Details
-
orderMap
-
computedKeysComparator
-
specialChild
-
literalChildren
-
computedChildren
-
-
Constructor Details
-
CardinalityCompositeSpec
-
-
Method Details
-
createChildren
Recursively walk the spec input tree. -
applyCardinality
public boolean applyCardinality(String inputKey, Object input, WalkedPath walkedPath, Object parentContainer) If this Spec matches the inputkey, then perform one step in the parallel treewalk. Step one level down the input "tree" by carefully handling the List/Map nature the input to get the "one level down" data. Step one level down the Spec tree by carefully and efficiently applying our children to the "one level down" data.- Specified by:
applyCardinality
in classCardinalitySpec
- Returns:
- true if this this spec "handles" the inputkey such that no sibling specs need to see it
-
process
-
applyKeyToLiteralAndComputed
private static void applyKeyToLiteralAndComputed(CardinalityCompositeSpec spec, String subKeyStr, Object subInput, WalkedPath walkedPath, Object input) This method implements the Cardinality matching behavior when we have both literal and computed children. For each input key, we see if it matches a literal, and it not, try to match the key with every computed child.
-