Skip to content

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

Notifications You must be signed in to change notification settings

gnuhpc/configurate

 
 

Repository files navigation

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.

Build Status: Travis CI

Javadocs: http://configurate.aoeu.xyz/apidocs

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>ninja.leaping.configurate</groupId>
    <artifactId>configurate-hocon</artifactId>
    <version>3.3</version> <!-- Update this with the most recent version -->
</dependency>

Gradle:

repositories {
    mavenCentral()
}

dependencies {
    compile 'ninja.leaping.configurate:configurate-hocon:3.3'
}

For other build systems, take a look at the full list on the Configurate site

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:

  • 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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 99.9%
  • Shell 0.1%