Configurate YAML

A simple configuration library for Java applications that can handle a variety of formats and provides a node-based data structure able to handle a wide variety of configuration schemas

License

License

Categories

Categories

config Application Layer Libs Configuration Configurate
GroupId

GroupId

me.lucko.configurate
ArtifactId

ArtifactId

configurate-yaml
Last Version

Last Version

3.5
Release Date

Release Date

Type

Type

jar
Description

Description

Configurate YAML
A simple configuration library for Java applications that can handle a variety of formats and provides a node-based data structure able to handle a wide variety of configuration schemas

Download configurate-yaml

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
org.yaml : snakeyaml jar 1.18
me.lucko.configurate : configurate-core jar 3.5
org.checkerframework : checker-qual Optional jar 2.4.0

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

Configurate

Configurate is a simple configuration library released under the Apache 2.0 that provides a node-tree representation of configurations in a variety of formats.

The upstream repository is located at SpongePowered/configurate - but doesn't seem to be receiving any updates.

This fork of configurate contains the following changes:

  • Implemented a loader for the XML format (upstream PR #90)
  • Implemented a loader for the TOML format (upstream PR #69)
  • A considerable number of improvements to the projects JavaDocs (upstream PR #92)
  • Changed the TypeSerializerCollection to select from available type serializers in the order they were added (upstream PR #88)
  • Introduced more consistent formatting in the build scripts (upstream PR #92)
  • Fix object mapping for interface/abstract field types (upstream PR #91 by @dags-)

Building

We use Maven, so this part is pretty easy.

Configurate requires JDK 8 to build and run.

Make sure Maven is installed and from the project's directory (the root of this repository), run mvn clean install to build Configuate and install its artifacts to the local Maven repository.

Usage

Maven:

<dependency>
    <groupId>me.lucko.configurate</groupId>
    <artifactId>configurate-hocon</artifactId>
    <version>3.4</version>
</dependency>

Gradle:

repositories {
    mavenCentral()
}

dependencies {
    compile 'me.lucko.configurate:configurate-hocon:3.4'
}

This dependency statement is for the hocon format implementation. Other formats managed in this repository use the same group id and versioning.

Now, to load:

ConfigurationLoader<CommentedConfigurationNode> loader = HoconConfigurationLoader.builder().setPath(file).build(); // Create the loader
CommentedConfigurationNode node = loader.load(); // Load the configuration into memory

node.getNode("some", "value").getValue(); // Get the value

More detailed explanations of all the methods available in ConfigurationNode are available in the javadocs.

Contributing

We love PRs! However, when contributing, here are some things to keep in mind:

  • Take a look at open issues first before you get too far in -- someone might already be working on what you were planning on doing
  • In general, we follow the Oracle style guidelines for code style
  • Please, please, please test PRs. It makes the process a lot easier for everybody :)

Versions

Version
3.5
3.4