Class Key

  • Direct Known Subclasses:
    ArrayKey, MapKey

    public abstract class Key
    extends java.lang.Object
    • Field Detail

      • isArrayOutput

        private boolean isArrayOutput
      • op

        private OPS op
      • orCount

        private int orCount
      • outputArraySize

        private int outputArraySize
      • children

        protected java.util.Set<Key> children
      • literalValue

        protected java.lang.Object literalValue
      • rawKey

        protected java.lang.String rawKey
      • keyStrings

        protected java.util.List<java.lang.String> keyStrings
    • Constructor Detail

      • Key

        public Key​(java.lang.String rawJsonKey,
                   java.lang.Object spec)
    • Method Detail

      • parseSpec

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

        private static java.util.Set<Key> processSpec​(boolean parentIsArray,
                                                      java.util.Map<java.lang.String,​java.lang.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​(java.lang.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​(java.lang.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 java.lang.Object createOutputContainerObject()