A YAML wrapper for Java to make it much easier to use these configuration files.
- Load/save YAML from/to a file or string.
- Get, set and check YAML keys and/or sections in the preferred data type.
- Easily format/parse lists or objects.
- Use a default value if the requested key doesn't exist.
- Set a base YAML configuration to use as fallback, if a key doesn't exist.
- Use isolated sub-sections of a YAML configuration, as if you're using a full YAML file.
- Various useful helper methods to streamline your YAML configuration usage.
This YAML wrapper library makes using YAML configurations very easy in your Java project. The wrapper uses the SnakeYaml library as it's backend for interacting with YAML files, and provides a nice, clean and easy to use set of classes as abstraction. This library is perfect to use for your own project if you'd like to implement YAML configuration file support.
To use the YAML wrapper library in your own project, you must include it as dependency. The library can be added to your project by using Maven, or it can be done manually by adding the library JAR-file. See below.
Include the following repository and dependency in your Maven configuration to use the YAML wrapper in your own project.
<repositories>
<!-- Xephi repository -->
<repository>
<id>xephi-repo</id>
<url>https://repo.codemc.org/repository/maven-public/</url>
</repository>
</repositories>
<dependencies>
<!-- YAML wrapper library -->
<dependency>
<groupId>com.timvisee</groupId>
<artifactId>yamlwrapper</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies>
To download the JAR-file see the Download section. This JAR-file should be added as library to your own project, in order to use it.
File | Build Status | Download |
---|---|---|
JAR library | Latest successful | Download |
ZIP with JAR library | Latest successful | Download |
All JAR-files for the YAML wrapper library can be found and downloaded from on our Jenkins page. It is recommended however, to compile your own JAR-file using Maven whenever that's possible.
A runnable usage example is included in the Example.java file.
The project is currently being built automatically using the CI services in the table below.
Service | Platform | Branch | Build Status | |
---|---|---|---|---|
Jenkins | Linux | master | View status | |
Travis CI | Linux | master | View status | |
Travis CI | Linux | last commit | View status |
- Fork the project.
- Create a branch:
git checkout -b my-feature-branch
- Commit your changes:
git commit -m "Add new specific feature"
- Push to the branch:
git push origin my-feature-branch
- Open a Pull Request.
- Enjoy a refreshing Diet Coke and wait.
This project is released under the GNU GPL-3.0 license. Check out the LICENSE file for more information.