Class JsonObject<K,​V>

  • Type Parameters:
    K - field name in Map-of-Map
    V - Value
    All Implemented Interfaces:
    Serializable, Cloneable, Map<K,​V>

    public class JsonObject<K,​V>
    extends LinkedHashMap<K,​V>
    This class holds a JSON object in a LinkedHashMap. LinkedHashMap used to keep fields in same order as they are when reflecting them in Java. Instances of this class hold a Map-of-Map representation of a Java object, read from the JSON input stream.
    Author:
    John DeRegnaucourt ([email protected])
    Copyright (c) Cedar Software LLC

    Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.*
    See Also:
    Serialized Form
    • Constructor Detail

      • JsonObject

        public JsonObject()
    • Method Detail

      • getId

        public long getId()
      • hasId

        public boolean hasId()
      • setType

        public void setType​(String type)
      • getType

        public String getType()
      • getTarget

        public Object getTarget()
      • setTarget

        public void setTarget​(Object target)
      • getTargetClass

        public Class getTargetClass()
      • isLogicalPrimitive

        public boolean isLogicalPrimitive()
      • getPrimitiveValue

        public Object getPrimitiveValue()
      • isReference

        public boolean isReference()
        Returns:
        boolean true if this object references another object, false otherwise.
      • getReferenceId

        public Long getReferenceId()
      • isMap

        public boolean isMap()
      • isCollection

        public boolean isCollection()
      • isArray

        public boolean isArray()
      • getArray

        public Object[] getArray()
      • getLength

        public int getLength()
      • getComponentType

        public Class getComponentType()
      • put

        public V put​(K key,
                     V value)
        Specified by:
        put in interface Map<K,​V>
        Overrides:
        put in class HashMap<K,​V>
      • getLine

        public int getLine()
        Returns:
        int line where this object '{' started in the JSON stream
      • getCol

        public int getCol()
        Returns:
        int column where this object '{' started in the JSON stream
      • size

        public int size()
        Specified by:
        size in interface Map<K,​V>
        Overrides:
        size in class HashMap<K,​V>