net.cadrian.jsonref:jsonref

JSON/R is an extended JSON format that natively supports object references, thus allowing to de/serialize object graphs, even with cycles.

Лицензия

Лицензия

MIT
Категории

Категории

Сеть JSON Данные
Группа

Группа

net.cadrian.jsonref
Идентификатор

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

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

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

0.0.11
Дата

Дата

Тип

Тип

pom
Описание

Описание

net.cadrian.jsonref:jsonref
JSON/R is an extended JSON format that natively supports object references, thus allowing to de/serialize object graphs, even with cycles.
Ссылка на сайт

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

https://github.com/cadrian/jsonref
Система контроля версий

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

https://github.com/cadrian/jsonref

Скачать jsonref

Имя Файла Размер
jsonref-0.0.11.pom 4 KB
Обзор

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

<!-- https://jarcasting.com/artifacts/net.cadrian.jsonref/jsonref/ -->
<dependency>
    <groupId>net.cadrian.jsonref</groupId>
    <artifactId>jsonref</artifactId>
    <version>0.0.11</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/net.cadrian.jsonref/jsonref/
implementation 'net.cadrian.jsonref:jsonref:0.0.11'
// https://jarcasting.com/artifacts/net.cadrian.jsonref/jsonref/
implementation ("net.cadrian.jsonref:jsonref:0.0.11")
'net.cadrian.jsonref:jsonref:pom:0.0.11'
<dependency org="net.cadrian.jsonref" name="jsonref" rev="0.0.11">
  <artifact name="jsonref" type="pom" />
</dependency>
@Grapes(
@Grab(group='net.cadrian.jsonref', module='jsonref', version='0.0.11')
)
libraryDependencies += "net.cadrian.jsonref" % "jsonref" % "0.0.11"
[net.cadrian.jsonref/jsonref "0.0.11"]

Зависимости

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

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

  • jsonref-core

Build Status

See http://cadrature.blogspot.fr/2015/06/jsonr.html

Why a new JSON parser?

JSON is well and good, but it has one shortcoming: the management of object references. When you have to serialize an object graph, with object cycles, JSON is lost.

I needed to serialize such a graph. So I wrote a JSON extension, dubbed "JSON/R" (JSON with references).

I wanted the parser to stay as pretty as the standard JSON's (see a previous article), with the same property: a parser with no backtrack.

I added two concepts: "heap" and "reference".

A "heap" is just an array with different brackets (< and >); its usage is that the objects in it are referenced by their position in the array. By convention, the root object of the graph (i.e. the one the serialization started from) is the first one, noted $0 (see below).

A "reference" is an index into the heap: noted $<integer>.

An example

<{"class":"net.cadrian.jsonref.Pojo","reference":$1,"timestamp":"3915-07-10T12:00:00.000","value":"a"},{"class":"net.cadrian.jsonref.Pojo","reference":$0,"timestamp":null,"value":"b"}>

The class is a simple pojo with a String value, a Date timestamp, and another Pojo reference. The example above shows two objects referencing each other.

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

Версия
0.0.11
0.0.10
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4