Fastjson Alibaba Json tool use

FastJson Download

Foreword

JSON is what?

1.json not difficult to understand, simple point understand the format of data exchange is a kind of

Only two structural 2.json An Array is another object, and both can be nested within each other, the object is {}, [] is an array
JSON (JavaScript Object Notation, JS objects notation) is a lightweight level data exchange format. It is based on a subset of ECMAScript (European Computer Society norms established by js), using completely independent of the programming language of the text format to store and represent data. Simple and clear hierarchy make JSON an ideal data-interchange language. Easy to read and write, but also easy for machines to parse and generate, and effectively improve the efficiency of network transmission.

JSON array of objects

Json data format:

[
	{"ID": 1001, "name": "张三", "age": 24},
	{"ID": 1002, "name": "李四", "age": 25},
	{"ID": 1003, "name": "王五", "age": 22}
]

1: Data in brackets (interpreted as an array)

2: square brackets appear in each data object in the json

3: every two data separated by commas (comma last one without)

What FastJson that?

Fastjson Alibaba is the fastest open source and object Json conversion tool, written in a language Java JSON processor.

FastJson simple use case

public static void main(String[] args) {
		List<String> list =new ArrayList();
		list.add("name:张H");
		list.add("sex:男");
		list.add("phone:18181859014");
		list.add("email:[email protected]");
		String result = JSON.toJSONString(list);
		System.out.println(result);
	}

operation result:

["name:张H","sex:男","phone:18181859014","email:[email protected]"]
Published 12 original articles · won praise 17 · views 2980

Guess you like

Origin blog.csdn.net/qq1140037586/article/details/105298255