json_adaptor [TAST DokuWiki ]

User Tools

Site Tools


Sidebar

First steps in TAST

What is UML

Computer setup for TAST use

FAQ

Recognized Issues

TAST tool Menu

TAST Adaptors

Adaptors examples

TAST Integrations

Interesting features

Documentation of technical administration

Modeling recommendations

Training in the TAST tool

json_adaptor

JSON Adaptor

Introduction

The JSON adapter allows you to interact with a .json file, thanks to a variety of predefined functions that allow you to retrieve and commit the existence of values ​​through a tagName or a JsonPath.

Initialization parameters

  • JsonFilePath: directory or full path of the json file.

Predefined Functions (PF)

  • getALLJSONElementInfoByTagName: this function allows you to retrieve all the values ​​of an element, with its depth level in a JSON file and return them under a three-column TastDataTable ( TagName, value, level ). You can also filter the result by specifying the low level the one to find the TagName.
    • Input parameters: TagName, LevelPosition.
    • Output parameters: 3 column #TASTTABLEDATA (tagName, value, level).
  • getALLJSONElementValueByTagName: this function allows you to retrieve all the values ​​of an element, associated with the TagName, as an array of values. Presented by a TastRowValues ​​object.
    • Input parameters: TagName.
    • Output parameters: #TASTROWVALUES Array with STRING type values.
  • getElementsCountByJsonPath: this function allows you to retrieve the number of elements that match the given JSONPath.
    • Input parameters: JsonPath.
    • Output parameters: #INTEGER Number of elements matching the jsonPath.
  • getElementsCountByTagName: this function allows you to retrieve the number of elements that match the given TagName.
    • Input parameters: TagName.
    • Output parameters: #INTEGER Number of elements matching the tagName.
  • getElementsValueByJsonPath: this function allows you to retrieve TASTROWVALUES with the values ​​of the tags that have the same JSONPath.
    • Input parameters: JsonPath.
    • Output parameters: #TASTROWVALUES Array of type STRING with the values of the tags.
  • getJSONElementValueByJsonPath: this function allows you to retrieve the value of an element, using a JSONPath expression to identify the element.
    • Input parameters: JsonPath.
    • Output parameters: #STRING Tag value matching the jsonPath.
  • getJSONElementValueByTagName: this function allows you to recover the value of an element, using the TagName to identify the value to be recovered. If there are multiple elements with this TagName, the value of the first element will be returned.
    • Input parameters: TagName.
    • Output parameters: #STRING Value of the tag that has that tagName attribute.
json_adaptor.txt · Last modified: 2023/12/26 10:50 by montse