(Replacing message template with parser tag) |
Charles Olet (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
<message>Write the content here to display this box</message> | <message>Write the content here to display this box</message> | ||
[[Category:OCLOperators]] | [[Category:OCLOperators]] | ||
{{Edited|July|12|2024}} | {{Edited|July|12|2024}}The JsonToObjects OCL operator is for converting a JSON string to a class object. The operator accommodates Model structures having more than one class with relationships. | ||
Inorder for the JSON data to be captured, the model classes attributes have to match the JSON properties. | |||
Example | |||
The MDriven Designer has a feature to '''add attributes, associations and classes from clipboard json''', this feature is very handy in ensuring your Model classes match and fit the structure of the JSON data. | |||
Copy the JSON data | |||
Create a class that with act as the root for the JSON structure | |||
Copy the JSON data that needs to be saved in the Model making sure the curly braces ({}) are the root and included in the data copied. | |||
Right Click on the root class and select '''Add attributes, assoc, and classes from clipboard json or xml''' option from options which will try to parse the copied JSON from the clipboard and create a class or classes structure that fits the JSON data. | |||
Other Pages: | |||
* [[Import_xml_and_JSon_with_MDriven]] |
Revision as of 23:57, 15 August 2024
The JsonToObjects OCL operator is for converting a JSON string to a class object. The operator accommodates Model structures having more than one class with relationships.
Inorder for the JSON data to be captured, the model classes attributes have to match the JSON properties.
Example
The MDriven Designer has a feature to add attributes, associations and classes from clipboard json, this feature is very handy in ensuring your Model classes match and fit the structure of the JSON data.
Copy the JSON data
Create a class that with act as the root for the JSON structure
Copy the JSON data that needs to be saved in the Model making sure the curly braces ({}) are the root and included in the data copied.
Right Click on the root class and select Add attributes, assoc, and classes from clipboard json or xml option from options which will try to parse the copied JSON from the clipboard and create a class or classes structure that fits the JSON data.
Other Pages: