org.leadpony.joy.yaml

Joy is yet another implementation of the JSON Processing API (JSR 374).

License

License

GroupId

GroupId

org.leadpony.joy
ArtifactId

ArtifactId

joy-yaml
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

org.leadpony.joy.yaml
Joy is yet another implementation of the JSON Processing API (JSR 374).

Download joy-yaml

How to add to project

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

Dependencies

compile (2)

Group / Artifact Type Version
org.leadpony.joy : joy-core jar 2.1.0
org.snakeyaml : snakeyaml-engine jar 2.1

Project Modules

There are no modules declared in this project.

Joy

Apache 2.0 License Maven Central Javadocs Build Status

Joy is yet another implementation of Jakarta JSON Processing API (JSON-P).

Key Features

Getting Started

Joy version 2

Joy version 2 is an implementation of Jakarta JSON Processing API version 2.x, which is now migrated to jakarta.json package. Please note that this is still a prerelease and the API may be changed.

For using this version, the following 2 dependencies neeed to be added in your pom.xml as an API and its implementation, respectively.

<dependency>
    <groupId>jakarta.json</groupId>
    <artifactId>jakarta.json-api</artifactId>
    <version>2.0.0</version>
</dependency>

<dependency>
    <groupId>org.leadpony.joy</groupId>
    <artifactId>joy-classic</artifactId>
    <version>2.1.0</version>
    <scope>runtime</scope>
</dependency>

Joy version 1

Joy version 1 is an implementation of Jakarta JSON Processing API version 1, which was defined in javax.json package. For using this version, the following 2 dependencies neeed to be added in your pom.xml as an API and its implementation, respectively.

<dependency>
    <groupId>jakarta.json</groupId>
    <artifactId>jakarta.json-api</artifactId>
    <version>1.1.6</version>
</dependency>

<dependency>
    <groupId>org.leadpony.joy</groupId>
    <artifactId>joy</artifactId>
    <version>1.3.0</version>
    <scope>runtime</scope>
</dependency>

Beyond the Standard API

For using the provider-specific API shown below, scope element of dependency must be changed from runtime to compile or be removed entirely.

The provider-specific API is available in org.leadpony.joy.api package.

JsonGenerator

The following configuration properties are added.

  • INDENTATION_SIZE

    Specifies the number of spaces to be used as an indentation. The value of the property must be an integer. By default the number is 4.

  • TAB_INDENTATION

    Uses a tab for indentation instead of spaces. The value of the property could be anything.

YAML Support

All you need to do for parsing/reading YAML documents is switching the implementation from joy-classic to joy-yaml as shown below:

<dependency>
    <groupId>org.leadpony.joy</groupId>
    <artifactId>joy-yaml</artifactId>
    <version>2.1.0</version>
    <scope>runtime</scope>
</dependency>

Please note that there are some restrictions in the current implementation of joy-yaml.

  • Aliases are not supported and cause the parser/reader to throw an exception.
  • Anchors are silently ignored.
  • Multiple documents are not supported.
  • Both generating and writing YAML documents are not supported yet.

Additional Resources

Building from Source

JDK 14 and Maven are the tools required to build this software. The following command builds and install it into your local Maven repository.

mvn clean install -P release

Other Solutions

There are other implementations compatible with this software.

Copyright Notice

Copyright 2019-2021 the original author or authors. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this product except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Versions

Version
2.1.0
2.0.0
2.0.0-RC2