Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space WDESIGNER and version 24.0
Div
Excerpt
Syntax
Code Block
languagenone
set aString = anObject.classToExtendedJson()
set aString = anObject.classToExtendedJson(format)
set aString = anObject.classToExtendedJson(options)
Semantics

The operation classToExtendedJson() takes any object (anObject) and tries to map it to an Extended JSON string aString.

Info

In opposition to classToJSON, classToExtendedJson() preserves the order of attributes of the converted class. JSON types and xUML types are mapped as listed in chapter jsonToClass. These details also refer to Extended JSON.

If the conversion is not possible, an error is raised.

Info

classToExtendedJSON() does not support cyclic structures. When a cyclic structure is detected during serializing the given object, an exception will be thrown.

SubstitutablesanObjectAny object. 
aStringTarget Extended JSON document as String.
formatString that specifies the format of the Extended JSON that should be produced (more details see options below).
options

This optional parameter is an object of type ExtendedJSONComposerOptions.

Its attributes are:

AttributeTypeDescriptionAllowed Values
formatStringUse format to specify which kind of Extended JSON should be produced: canonical or relaxed Extended JSON.canonicalProduce canonical Extended JSON (default).
relaxedProduce relaxed Extended JSON.
keepNullsBooleanWhen keepNulls is true, attributes of anObject with NULL values will be rendered to the Extended JSON object, otherwise they will be left out completely (see also chapter NULL Values). The default behavior of classToJson() (i.e. when called without options) is equivalent to keepNulls=false.trueRender NULL attributes to the Extended JSON string.
falseLeave out NULL attributes (default).
writeTypeDiscriminatorBoolean

Multiexcerpt include
SpaceWithExcerptINTERNAL
MultiExcerptNamewriteTypeDiscriminator
PageWithExcerptINTERNAL:_designer_excerpts_asl
shouldDisplayInlineCommentsInIncludesfalse
This is necessary if you want to convert the generated Extended JSON back to an xUML class using extendedJSONToClass.

Info

In contrast to classToJSON, writeTypeDiscriminator defaults to false for classToExtendedJson().

trueWrite xUML type discriminator.
falseDo not write xUML type discriminator (default).
Examples
Code Block
languagenone
set aMongoDBdocument = myAddress.classToExtendedJson();set aMongoDBdocument = myAddress.classToExtendedJson("relaxed");

For more information on Extended JSON refer to MongoDB Extended JSON.

Div
Stylemargin-top: -21px;

Multiexcerpt include
SpaceWithExcerptINTERNAL
MultiExcerptNameMongoDBAdapter_CustomerData_Example
PageWithExcerptINTERNAL:_designer_examples
shouldDisplayInlineCommentsInIncludesfalse

rp
Panel
titleRelated Pages:
rde
Panel
titleRelated Documentation: