net.markenwerk:utils-json-handler-xml

XML handler for JSON processing libraries for Java

Лицензия

Лицензия

Категории

Категории

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

Группа

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

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

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

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

2.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

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

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

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

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

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

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

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

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

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

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

Зависимости

compile (1)

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

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.xmlunit : xmlunit-core jar 2.3.0

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

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

XML handler for JSON libraries

Build Status Coverage Status Dependency Status Maven Central Issues MIT License

Overview

This library provides XML 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-xml</artifactId>
	<version>2.0.1</version>
</dependency>

Usage

XML document handler

A XmlDocumentJsonHandler is a JsonHandler that creates a XML Document, that represents the described JSON document, using the following rules:

  • A JSON array is represented as a tag with name array.
  • A JSON object is represented as a tag with name object.
  • A JSON object entry is represented as a tag with name entry.
  • The name of a JSON object entry is represented as an attribute of the entry tag with name name.
  • A JSON null is represented as a tag with name null.
  • A JSON boolean is represented as a tag with name boolean.
  • The value of the JSON boolean represented as an attribute of the boolean tag with name value.
  • A JSON number is represented as a tag with name number.
  • The value of the JSON boolean represented as an attribute of the number tag with name value.
  • A JSON string is represented as a tag with name string.
  • The value of the JSON boolean represented as an attribute of the string tag with name value.
// a JsonDocument
JsonDocument document = ...

// returns a xml document  
Document xmlDocument = document.handle(new XmlDocumentJsonHandler());

The returned XML Document for the example.json has the following content:

<?xml version="1.0" encoding="UTF-8"?>
<object>
   <entry name="null">
      <null />
   </entry>
   <entry name="boolean">
      <boolean value="true" />
   </entry>
   <entry name="longValue">
      <number value="-42" />
   </entry>
   <entry name="double">
      <number value="-23.42" />
   </entry>
   <entry name="array">
      <array>
         <string value="foo" />
         <string value="bar" />
      </array>
   </entry>
</object>
net.markenwerk

Markenwerk

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

Версия
2.0.1
2.0.0
1.0.0