Warning: Use of undefined constant Symbol - assumed 'Symbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215 Warning: Use of undefined constant JavaScriptSymbol - assumed 'JavaScriptSymbol' (this will throw an Error in a future version of PHP) in /mnt/new-ebs/workbench-106550/lib/dojo/util/docscripts/lib/parser2/dojo2.inc on line 215

dojox/json/ref.js

  • Provides:

    • dojox.json.ref
  • Requires:

    • dojo.date.stamp in common
  • dojox.json.ref

    • summary
      Adds advanced JSON {de}serialization capabilities to the base json library.
      This enhances the capabilities of dojo.toJson and dojo.fromJson,
      adding referencing support, date handling, and other extra format handling.
      On parsing, references are resolved. When references are made to
      ids/objects that have been loaded yet, the loader function will be set to
      _loadObject to denote a lazy loading (not loaded yet) object.
    • type
      Object
  • dojox.json.ref.resolveJson

    • parameters:
      • root: (typeof Object)
        The root object of the object graph to be processed
      • args: (typeof Object)
        with additional arguments:
        
        The *index* parameter.
        This is the index object (map) to use to store an index of all the objects.
        If you are using inter-message referencing, you must provide the same object for each call.
        The *defaultId* parameter.
        This is the default id to use for the root object (if it doesn't define it's own id)
        The *idPrefix* parameter.
        This the prefix to use for the ids as they enter the index. This allows multiple tables
        to use ids (that might otherwise collide) that enter the same global index.
        idPrefix should be in the form "/Service/".  For example,
        if the idPrefix is "/Table/", and object is encountered {id:"4",...}, this would go in the
        index as "/Table/4".
        The *idAttribute* parameter.
        This indicates what property is the identity property. This defaults to "id"
        The *assignAbsoluteIds* parameter.
        This indicates that the resolveJson should assign absolute ids (__id) as the objects are being parsed.
        
        The *schemas* parameter
        This provides a map of schemas, from which prototypes can be retrieved
        The *loader* parameter
        This is a function that is called added to the reference objects that can't be resolved (lazy objects)
        return:
        An object, the result of the processing
    • summary
      Indexes and resolves references in the JSON object.
    • description
      A JSON Schema object that can be used to advise the handling of the JSON (defining ids, date properties, urls, etc)
    • type
      Function
  • dojox.json.ref.resolveJson.refAttribute

  • dojox.json.ref.resolveJson._addProp

  • dojox.json.ref.fromJson

    • parameters:
      • str: (typeof String)
        a string literal of a JSON item, for instance:
        '{ "foo": [ "bar", 1, { "baz": "thud" } ] }'
      • args: (typeof Object)
        See resolveJson
        
        return:
        An object, the result of the evaluation
    • summary
      evaluates the passed string-form of a JSON object.
    • type
      Function
  • dojox.json.ref.toJson

    • parameters:
      • it: (typeof Object)
        an object to be serialized.
      • prettyPrint: (typeof Boolean)
        if true, we indent objects and arrays to make the output prettier.
        The variable dojo.toJsonIndentStr is used as the indent string
        -- to use something other than the default (tab),
        change that variable before calling dojo.toJson().
      • idPrefix: (typeof Object)
        The prefix that has been used for the absolute ids
        
        return:
        a String representing the serialized version of the passed object.
      • indexSubObjects: (typeof Object)
    • returns
      use the default serializer for primitives
    • summary
      Create a JSON serialization of an object.
      This has support for referencing, including circular references, duplicate references, and out-of-message references
      id and path-based referencing is supported as well and is based on http://www.json.com/2007/10/19/json-referencing-proposal-and-library/.
    • type
      Function
  • dojox.json.ref.toJson._useRefs

  • dojox.json.ref.toJson._addProp

  • dojox.json.ref.toJson.refAttribute

  • dojox.json.ref._addProp

    • parameters:
      • id
      • prop
    • type
      Function
  • dojox.json.ref.refAttribute

    • type
      String
    • summary
      This indicates what property is the reference property. This acts like the idAttribute
      except that this is used to indicate the current object is a reference or only partially
      loaded. This defaults to "$ref".
  • dojox.json.ref._useRefs

    • type
      bool
  • dojox.json.ref.serializeFunctions

    • type
      bool
  • dojox.json

    • type
      Object
  • dojox

    • type
      Object