Class JSONObject


  • class JSONObject
    extends java.lang.Object
    An intermediate object in the (de)serialization process, representing a JSON Object.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.Object>> items
      Key/value mappings, in display order.
      (package private) java.lang.CharSequence objectId
      Object id for cross-references, if known.
    • Constructor Summary

      Constructors 
      Constructor Description
      JSONObject​(int sizeHint)
      Constructor.
      JSONObject​(java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.Object>> items)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void toJSONString​(java.util.Map<ReferenceEqualityKey<JSONReference>,​java.lang.CharSequence> jsonReferenceToId, boolean includeNullValuedFields, int depth, int indentWidth, java.lang.StringBuilder buf)
      Serialize this JSONObject to a string.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • items

        java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.Object>> items
        Key/value mappings, in display order.
      • objectId

        java.lang.CharSequence objectId
        Object id for cross-references, if known.
    • Constructor Detail

      • JSONObject

        public JSONObject​(int sizeHint)
        Constructor.
        Parameters:
        sizeHint - the size hint
      • JSONObject

        public JSONObject​(java.util.List<java.util.Map.Entry<java.lang.String,​java.lang.Object>> items)
        Constructor.
        Parameters:
        items - the items
    • Method Detail

      • toJSONString

        void toJSONString​(java.util.Map<ReferenceEqualityKey<JSONReference>,​java.lang.CharSequence> jsonReferenceToId,
                          boolean includeNullValuedFields,
                          int depth,
                          int indentWidth,
                          java.lang.StringBuilder buf)
        Serialize this JSONObject to a string.
        Parameters:
        jsonReferenceToId - a map from json reference to id
        includeNullValuedFields - if true, include null valued fields
        depth - the nesting depth
        indentWidth - the indent width
        buf - the buf