Class ShiftrTraversr<DataType>

java.lang.Object
com.bazaarvoice.jolt.traversr.Traversr<DataType>
com.bazaarvoice.jolt.traversr.SimpleTraversr<DataType>
com.bazaarvoice.jolt.shiftr.ShiftrTraversr<DataType>

public class ShiftrTraversr<DataType> extends SimpleTraversr<DataType>
Traverser that does not overwrite data.
  • Constructor Details

    • ShiftrTraversr

      public ShiftrTraversr(String humanPath)
    • ShiftrTraversr

      public ShiftrTraversr(List<String> paths)
  • Method Details

    • handleFinalSet

      public Optional<DataType> handleFinalSet(TraversalStep traversalStep, Object tree, String key, DataType data)
      Do a Shift style insert : 1) if there is no data "there", then just set it 2) if there is already a list "there", just add the data to the list 3) if there something other than a list there, grab it and stuff it and the data into a list and overwrite what is there with a list.
      Overrides:
      handleFinalSet in class SimpleTraversr<DataType>
      Returns:
      the data object if the set was successful, or null if not