Unlock instant, AI-driven research and patent intelligence for your innovation.

Strong type static programming language JSON analysis method

A programming language and parsing method technology, applied in the field of JSON format data parsing and storage, to improve code quality, reduce mental burden, and reduce development difficulty

Pending Publication Date: 2021-07-16
吴方军
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

But the disadvantage of this method is: For example, in a networked Andriod App, each JSON network request needs to create a corresponding Model class, resulting in a project filled with a large number of Model classes just for parsing JSON data, and slightly changing the JSON string The data structure and the Model class attribute structure have to be changed again;

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Strong type static programming language JSON analysis method
  • Strong type static programming language JSON analysis method
  • Strong type static programming language JSON analysis method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0031] see Figure 1-6 , the present invention provides a technical solution:

[0032] The principles and features of the present invention will be described below in conjunction with the accompanying drawings, and the examples listed are only used to explain the present invention, and are not intended to limit the scope of the present invention.

[0033] The technical solution of the present invention allows the static programming language to have the same flexible and concise JSON string parsing capability as the dynamic programming language, and a line of code can parse any data that needs to be parsed.

[0034] The core point of the present invention is to create a third new JSON parsing technical solution other than the above-mentioned 1 and 2, and use ePath to obtain JSON data (generic types can be selected for confirmation).

[0035] For example, if the JSON string is: {"name":"Fenger","arms":[{"name":"gun"},{"name":"sword"}]}, if you want Obtain the value ...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention relates to a strong type static programming language JSON (JavaScript Object Notation) analysis method, which comprises the following steps of: only needing Json.gett; the method comprises the following steps: carrying out Stringt; according to the method, the value can be obtained through one line of codes (arm [1]. Name), so that the code quality is greatly improved, the development difficulty is reduced, the development speed is improved, and the mental burden is reduced. No matter how deep the hierarchy is, the data can be analyzed and collected in one row. The specification of the ePath is as follows: obtaining a direct field name of a field, obtaining a field use point grammar under a JSON object, obtaining a mode of wrapping a subscript by a value use square support under a JSON array, the use is extremely simple and easy to understand, and generic json.gett can be selectively declared during obtaining; the method comprises the following steps: carrying out Stringt; (Arms [1]. Name)) is used for confirming a generic type, and type judgment and type conversion can also be automatically carried out by json.get (Arms [1]. Name)). According to the method, data updating is carried out, only json.set ('arms [1]. Name ', 'Jack') is needed, and the value can be updated by transmitting ePath, the value and a row of codes. A ToString () method is provided, and the original string is returned.

Description

technical field [0001] The invention relates to the field of software technical data analysis, in particular to a JSON format data analysis and storage method. Background technique [0002] In current programming development, any strongly typed programming language such as C / C++, Java, Dart, Objective-C, etc., because the strongly typed language needs to confirm the static type of the variable in advance, so there are currently only two mainstreams when parsing JSON strings Very troublesome technical solution, take the Java language as an example: [0003] 1. Use the JSONObject class to parse JSON strings, and the class library converts JSON strings into containers such as Map and List for reception. The disadvantage of this method is that it is very troublesome to use, and the type is not easy to determine, and it is not safe, so a lot of if judgments need to be made when using data to prevent the code from getting empty data or type mismatch, especially when JSON After t...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F8/30G06F40/221
CPCG06F8/30G06F40/221
Inventor 吴方军
Owner 吴方军