Class Key

java.lang.Object
com.bazaarvoice.jolt.defaultr.Key
Direct Known Subclasses:
ArrayKey, MapKey

public abstract class Key extends Object
  • Field Details

    • OR_INPUT_REGEX

      private static final String OR_INPUT_REGEX
      See Also:
    • keyComparator

      private static final Key.KeyPrecedenceComparator keyComparator
    • isArrayOutput

      private boolean isArrayOutput
    • op

      private OPS op
    • orCount

      private int orCount
    • outputArraySize

      private int outputArraySize
    • children

      protected Set<Key> children
    • literalValue

      protected Object literalValue
    • rawKey

      protected String rawKey
    • keyStrings

      protected List<String> keyStrings
  • Constructor Details

  • Method Details

    • parseSpec

      public static Set<Key> parseSpec(Map<String,Object> spec)
      Factory-ish method that recursively processes a Mapinvalid input: '<'String, Object> into a Set objects.
      Parameters:
      spec - Simple Jackson default Mapinvalid input: '<'String,Object> input
      Returns:
      Set of Keys from this level in the spec
    • processSpec

      private static Set<Key> processSpec(boolean parentIsArray, Map<String,Object> spec)
      Recursively walk the spec input tree. Handle arrays by telling DefaultrKeys if they need to be ArrayKeys, and to find the max default array length.
    • applyChildren

      public void applyChildren(Object defaultee)
      This is the main "recursive" method. The defaultee should never be null, because the defaultee wasn't null, it was null and we created it, OR there was a mismatch between the Defaultr Spec and the input, and we didn't recurse.
    • getLiteralIntKey

      protected abstract int getLiteralIntKey()
    • applyChild

      protected abstract void applyChild(Object container)
      Apply this Key to the defaultee. If this Key is a WildCard key, this may apply to many entries in the container.
    • getOrCount

      public int getOrCount()
    • isArrayOutput

      public boolean isArrayOutput()
    • getOp

      public OPS getOp()
    • getOutputArraySize

      public int getOutputArraySize()
    • createOutputContainerObject

      public Object createOutputContainerObject()