JSON

A very lite and powerful JSON parser/serializer Java implementation.

Лицензия

Лицензия

Категории

Категории

JSON Данные
Группа

Группа

tech.sobin
Идентификатор

Идентификатор

json
Последняя версия

Последняя версия

1.2.0
Дата

Дата

Тип

Тип

jar
Описание

Описание

JSON
A very lite and powerful JSON parser/serializer Java implementation.
Ссылка на сайт

Ссылка на сайт

https://github.com/carbon-lab/JSON
Система контроля версий

Система контроля версий

https://github.com/carbon-lab/JSON/tree/master

Скачать json

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/tech.sobin/json/ -->
<dependency>
    <groupId>tech.sobin</groupId>
    <artifactId>json</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/tech.sobin/json/
implementation 'tech.sobin:json:1.2.0'
// https://jarcasting.com/artifacts/tech.sobin/json/
implementation ("tech.sobin:json:1.2.0")
'tech.sobin:json:jar:1.2.0'
<dependency org="tech.sobin" name="json" rev="1.2.0">
  <artifact name="json" type="jar" />
</dependency>
@Grapes(
@Grab(group='tech.sobin', module='json', version='1.2.0')
)
libraryDependencies += "tech.sobin" % "json" % "1.2.0"
[tech.sobin/json "1.2.0"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

JSON

A very lite and powerful JSON parser/serializer implementation.

Get start

It's easy.

If you want to parse JSON string in java, use: JSON.parse(json).

Similarly, if you want to convert a JSObject instance to a JSON string, just JSON.stringify(object)

Classes

Here talk about the classes.

Firstly, all the classes you might use in this project is named start with 'JS'. And all of them are the sub-class of JSBase directly or indirectly.

The JSObject is similar to the Java standard class Map<String, JSBase> which use a string object to map other JSON object. But it is NOT a sub-class of Map.

The JSArray is used to hold the data of the array in JSON. It is similar to Map<Integer, JSBase>.

Other class is stand for the base type of JSON like number, string, etc.

JSON

This is a programming interface class. It only contains two functions: parse and stringify.

The parse function is used to parse a JSON string and returns a JSObject object which could also be a JSArray object.

public static JSObject parse(String json)

stringify functions will returns the JSON string of any JSObject instance.

public static String stringify(JSObject object)

JSObject

// Set a field in JSON object
public JSBase put(String key, JSBase value)

// Get a field from JSON object
public JSBase get(String key)

// Get the key-value entry set
public Set<Entry<String, JSBase>> entrySet()

JSArray

// Set s value in the array by number index
public void set(int index, JSBase value)

// Get a value in the array by number index
public JSBase get(int index)

// Get the amount of elements
public int length()

// Append an element to the array end, like push() in JavaScript
public void push(JSBase value)

Версии библиотеки

Версия
1.2.0
1.1.0
1.0.0