Thanks to visit codestin.com
Credit goes to github.com

Skip to content
github-actions[bot] edited this page Oct 17, 2025 · 4 revisions

Okaeri Configs Wiki

⚠️ Note: This wiki has been primarily generated and maintained using AI assistance. While we strive for accuracy, please report any errors or inconsistencies in the GitHub Issues.

Welcome to the comprehensive documentation for Okaeri Configs - a powerful, lightweight Java configuration library that makes working with configuration files simple and type-safe.

What is Okaeri Configs?

Okaeri Configs is a modern Java configuration library that allows you to use Java classes as configuration adapters. It provides a clean, annotation-based approach to managing application settings across multiple formats and platforms.

Key Features

  • 🎯 Type-Safe Configurations: Use Java classes with getters/setters for compile-time safety
  • 💬 Comment Support: Add persistent comments and headers to your config files
  • 🔄 Multiple Formats: YAML, JSON, HJSON, HOCON support out of the box
  • 🎮 Platform Support: Special integrations for Bukkit, Bungee, and more
  • 📦 Lightweight: Core library is only ~129kB
  • Validation: Built-in validation support (Okaeri Validator, Jakarta EE)
  • 🔌 Extensible: Custom serializers, transformers, and format support
  • 🌍 Environment Variables: Built-in support for environment variable substitution

Quick Example

@Header("################################")
@Header("#   My Application Config      #")
@Header("################################")
public class AppConfig extends OkaeriConfig {

    @Comment("Application settings")
    private String appName = "MyApp";
    private Integer maxConnections = 100;

    @Variable("API_KEY")
    @Comment("API key (can be set via environment variable)")
    private String apiKey = "your-key-here";

    @Comment("Server configuration")
    private ServerConfig server = new ServerConfig();

    public static class ServerConfig extends OkaeriConfig {
        private String host = "localhost";
        private Integer port = 8080;
    }
}

Usage:

AppConfig config = ConfigManager.create(AppConfig.class, (it) -> {
    it.withConfigurer(new YamlSnakeYamlConfigurer());
    it.withBindFile(new File("config.yml"));
    it.saveDefaults();
    it.load(true);
});

// Access with type safety
String appName = config.getAppName();
config.setMaxConnections(200);
config.save();

Documentation Structure

Getting Started

Core Concepts

Advanced Features

Help & Reference

Quick Links

Installation

Maven:

<repository>
    <id>okaeri-repo</id>
    <url>https://storehouse.okaeri.eu/repository/maven-public/</url>
</repository>

<dependency>
    <groupId>eu.okaeri</groupId>
    <artifactId>okaeri-configs-yaml-snakeyaml</artifactId>
    <version>{VERSION}</version>
</dependency>

Gradle (Kotlin DSL):

maven("https://storehouse.okaeri.eu/repository/maven-public/")
implementation("eu.okaeri:okaeri-configs-yaml-snakeyaml:{VERSION}")

See Getting Started for detailed installation instructions.

Common Configurations

Use Case Format Additional Dependencies
Bukkit Plugins YAML (Bukkit) okaeri-configs-yaml-bukkit + okaeri-configs-serdes-bukkit
Bungee Plugins YAML (Bungee) okaeri-configs-yaml-bungee
General Purpose YAML (SnakeYAML) okaeri-configs-yaml-snakeyaml
Standalone Apps HJSON (~193kB) okaeri-configs-hjson + okaeri-configs-validator-okaeri

All Format Modules

Format Artifact ID Notes
YAML (SnakeYAML) okaeri-configs-yaml-snakeyaml General-purpose YAML. Good balance of features and compatibility.
YAML (Bukkit) okaeri-configs-yaml-bukkit Uses Bukkit's built-in YAML library. Useful for Bukkit plugins.
YAML (Bungee) okaeri-configs-yaml-bungee Uses BungeeCord's YAML library. Useful for Bungee plugins.
JSON (Gson) okaeri-configs-json-gson Based on Google's Gson. No comment support.
JSON (Simple) okaeri-configs-json-simple Based on json-simple. No indentation, no comments.
HJSON okaeri-configs-hjson Human-friendly JSON. Supports comments. Recommended for standalone apps.
HOCON okaeri-configs-hocon-lightbend Based on Lightbend Config. Limited comments/ordering. Not recommended.

Community & Support

Contributing to the Wiki

Found an error or want to improve the documentation?

  1. Visit the GitHub repository
  2. Navigate to the .wiki/ directory
  3. Submit a pull request with your improvements

Ready to get started? Head over to Getting Started to create your first config!

Clone this wiki locally