Class ChainrEntry

java.lang.Object
com.bazaarvoice.jolt.chainr.spec.ChainrEntry

public class ChainrEntry extends Object
Helper class that encapsulates the information one of the individual transform entries in the Chainr spec's list.
  • Field Details

    • STOCK_TRANSFORMS

      public static final Map<String,String> STOCK_TRANSFORMS
      Map transform "operation" names to the classes that handle them
    • OPERATION_KEY

      public static final String OPERATION_KEY
      See Also:
    • SPEC_KEY

      public static final String SPEC_KEY
      See Also:
    • index

      private final int index
    • spec

      private final Object spec
    • operationClassName

      private final String operationClassName
    • joltTransformClass

      private final Class<? extends JoltTransform> joltTransformClass
    • isSpecDriven

      private final boolean isSpecDriven
  • Constructor Details

    • ChainrEntry

      public ChainrEntry(int index, Object chainrEntryObj, ClassLoader classLoader)
      Process an element from the Chainr Spec into a ChainrEntry class. This method tries to validate the syntax of the Chainr spec, whereas the ChainrInstantiator deals with loading the Transform classes.
      Parameters:
      index - the index of the chainrEntryObj, used in reporting errors
      chainrEntryObj - the unknown Object from the Chainr list
  • Method Details

    • extractOperationString

      private String extractOperationString(Map<String,Object> chainrEntryMap)
    • loadJoltTransformClass

      private Class<? extends JoltTransform> loadJoltTransformClass(ClassLoader classLoader)
    • getErrorMessageIndexSuffix

      public String getErrorMessageIndexSuffix()
      Generate an error message suffix what lists the index of the ChainrEntry in the overall ChainrSpec.
    • getSpec

      public Object getSpec()
      Returns:
      Spec for the transform, can be null
    • getJoltTransformClass

      public Class<? extends JoltTransform> getJoltTransformClass()
      Returns:
      Class instance specified by this ChainrEntry
    • isSpecDriven

      public boolean isSpecDriven()
      Returns:
      true if the Jolt Transform specified by this ChainrEntry implements the SpecTransform interface