Class MatchedElement

java.lang.Object
com.bazaarvoice.jolt.common.pathelement.BasePathElement
com.bazaarvoice.jolt.common.tree.MatchedElement
All Implemented Interfaces:
EvaluatablePathElement, PathElement
Direct Known Subclasses:
ArrayMatchedElement

public class MatchedElement extends BasePathElement implements EvaluatablePathElement
MatchedElement is the result of a "match" between a spec PathElement and some input data. MatchedElements are not thread safe, and should instead be stack / single Thread/Transform specific. This mutability was specifically added for the the HashCount functionality, which allows Shiftr to transform data form maps to lists.
  • Field Details

    • subKeys

      private final List<String> subKeys
    • hashCount

      private int hashCount
  • Constructor Details

    • MatchedElement

      public MatchedElement(String key)
    • MatchedElement

      public MatchedElement(String key, List<String> subKeys)
  • Method Details

    • evaluate

      public String evaluate(WalkedPath walkedPath)
      Description copied from interface: EvaluatablePathElement
      Evaluate this key as if it is an write path element.
      Specified by:
      evaluate in interface EvaluatablePathElement
      Parameters:
      walkedPath - "up the tree" list of LiteralPathElements, that may be used by this key as it is computing
      Returns:
      String path element to use for write tree building
    • getCanonicalForm

      public String getCanonicalForm()
      Description copied from interface: PathElement
      Get 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:
      getCanonicalForm in interface PathElement
      Returns:
      canonical String version of this PathElement
    • getSubKeyRef

      public String getSubKeyRef(int index)
    • getSubKeyCount

      public int getSubKeyCount()
    • getHashCount

      public int getHashCount()
    • incrementHashCount

      public void incrementHashCount()
      Here be mutability...