net.markenwerk:utils-json-handler-text

Text handler for JSON processing libraries for Java

Лицензия

Лицензия

Категории

Категории

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

Группа

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

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

utils-json-handler-text
Последняя версия

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

2.0.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

net.markenwerk:utils-json-handler-text
Text handler for JSON processing libraries for Java
Ссылка на сайт

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

https://github.com/markenwerk/java-utils-json-handler-text
Организация-разработчик

Организация-разработчик

Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH
Система контроля версий

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

https://github.com/markenwerk/java-utils-json-handler-text

Скачать utils-json-handler-text

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

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

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
net.markenwerk : utils-json-handler jar 2.0.1
net.markenwerk : utils-text-indentation jar 1.1.2

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

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

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

Text handler for JSON libraries

Build Status Coverage Status Dependency Status Maven Central Issues MIT License

Overview

This library provides text related JSON handlers for other JSON processing libraries.

Consult the documentation and the usage description for further information:

Maven

This library is hosted in the Maven Central Repository. You can use it with the following coordinates:

<dependency>
	<groupId>net.markenwerk</groupId>
	<artifactId>utils-json-handler-text</artifactId>
	<version>2.0.2</version>
</dependency>

Usage

Java text handler

An AppendingJavaTextJsonHandler is a JsonHandler that appends a text, that represents the described JSON document by mimicing the toString() behavior of Java collection classes, to an Appendable.

// a JsonDocument
JsonDocument document = ...

// writes a pretty printed json document into test.json  
Writer writer = new FileWriter(new File("test.json"));
document.handle(new AppendingJavaTextJsonHandler(writer));
writer.close();

The appended String for the example.json has the following content:

{null=null, boolean=true, long=-42, double=-23.42, array=[foo, bar]}

A JavaTextJsonHandler is a JsonHandler that creates a String, containing a text that represents the described JSON document by mimicing the toString() behavior of Java collection classes.

// a JsonDocument
JsonDocument document = ...

// returns a pretty printed json document  
String json = document.handle(new JavaTextJsonHandler(writer));

The returned String for the example.json has the following content:

{null=null, boolean=true, long=-42, double=-23.42, array=[foo, bar]}

JSON text handler

An AppendingJsonTextJsonHandler is a JsonHandler that appends a JSON text, that represents the described JSON document, to an Appendable.

// a JsonDocument
JsonDocument document = ...

// writes a pretty printed json document into test.json  
Writer writer = new FileWriter(new File("test.json"));
document.handle(new AppendingJsonTextJsonHandler(writer));
writer.close();

The appended String for the example.json has the following content:

{
    "null" : null,
    "boolean" : true,
    "long" : -42,
    "double" : -23.42,
    "array" : [
        "foo",
        "bar"
    ]
}

A JsonTextJsonHandler is a JsonHandler that creates a String, containing a JSON text that represents the described JSON document.

// a JsonDocument
JsonDocument document = ...

// returns a pretty printed json document  
String json = document.handle(new JsonTextJsonHandler(writer));

The returned String for the example.json has the following content:

{
    "null" : null,
    "boolean" : true,
    "long" : -42,
    "double" : -23.42,
    "array" : [
        "foo",
        "bar"
    ]
}
net.markenwerk

Markenwerk

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

Версия
2.0.2
2.0.1
2.0.0
1.0.0