ConfigLib icon

ConfigLib -----

A Minecraft library for saving, loading, updating, and commenting YAML configuration files




## What's Changed

* Prevent NPE in `tryCreateParentDirectories` by tomwmth in https://github.com/Exlll/ConfigLib/pull/40
----------, May 19, 2025

Add better support for environment variables

See corresponding documentation in the README.

Fix: Enforce serializers to only produce valid target types

All serializers were already required (by the specification) to only produce
valid target types. However, this restriction hasn't been enforced so far and
can cause unexpected errors during deserialization if custom serializers are
involved.

This fix constitutes a breaking change if you have custom serializers that
don't follow the spec. The output of serializers is now checked during
serialization; if it's not of a valid target type, an exception is thrown.
----------, Apr 27, 2025

Added support for post-processing configurations via annotations and methods.
----------, Feb 23, 2024

Added a builder option that lets you specify the file encoding to use when reading and writing files. (Thanks to WiIIiam278!)
----------, Jan 26, 2024

  • Added a new interface, IOStreamConfigurationStore, that provides the two methods read and write which take an InputStream and OutputStream, respectively. This interface is implemented by the YamlConfigurationStore class.
  • Added several static methods to the YamlConfigurations class that correspond to these new read/write methods.
----------, Dec 2, 2023

Support for polymorphic serialization

This release adds the Polymorphic and PolymorphicTypes annotations that can be used on types. Serializers for polymorphic types are not selected based on the compile-time types of configuration elements, but instead are chosen at runtime based on the actual types of their values. This enables adding instances of subclasses / implementations of a polymorphic type to collections.

Add SerializeWith annotation

This annotation enforces the use of the specified serializer for a configuration element or type. It can be applied to configuration elements (i.e. class fields and record components), to types, and to other annotations.

Add SerializerContext interface

Instances of this interface contain information about the context in which a serializer was selected. They are passed to the constructors of custom serializers if the serializers are instantiated by this library, or can alternatively be accessed through the new addSerializerFactory method of ConfigurationProperties objects.
----------, Aug 22, 2022

  • Added jitpack.io support
  • Added two new NameFormatters
    • LOWER_KEBAB_CASE
    • UPPER_KEBAB_CASE
  • Fixed handling of comments that contain newlines
----------, Aug 5, 2022

This update contains several new features:
  • Support for Java records
  • Support for File, Path, URL, URI, Instant
  • New project structure that makes it easier to add support for additional file types
... and some breaking changes:
  • The code for saving and loading YAML files was moved from the configlib-core to the configlib-yaml module:
    • The Configurations class has been renamed to YamlConfigurations and its methods their -YamlConfiguration affix.
  • FieldFormatter has been renamed to NameFormatter
----------, Jul 24, 2022

  • Added toBuilder method to create a builder from a properties object
  • Added serialization support for Bukkit's ConfigurationSerializable types
  • Added UUID serializer
----------, Jul 9, 2022

This release represents version 3.0.0 - a complete rewrite of this library. It adds support for several new features like subclassing and enums.

Check out the repository on GitHub!
----------, Jul 7, 2022

The Format annotation can be used to apply a FieldNameFormatter
to a Configuration without having to instantiate a Properties
object. The FieldNameFormatter returned by the annotation
takes precedence over the value returned by the Properties object.

Added FieldNameFormatters.UPPER_UNDERSCORE
----------, Sep 10, 2018

If your configuration has a lot of fields and you want to exclude some of these fields without making them final, static or transient, you can configure your properties object to use additional FieldFilters.

A FieldFilter filters the fields of a configuration class by a specified criterion. For example, if you only want to include fields whose names don't start with ignore, you would add the following filter:

Code (Text):
YamlProperties properties = YamlProperties.builder()
                    .addFilter(field -> !field.getName().startsWith("ignore"))
                    // ...
                    .build();
----------, Aug 25, 2018

Fix: Comments not saved if FieldNameFormatter is used
Fix: Converting back fails for nested collections of complex ConfigurationElements
----------, Aug 20, 2018

Make ConfigLib Java 8 compatible
----------, Aug 14, 2018

Resource Information
Author:
----------
Total Downloads: 1,549
First Release: Aug 9, 2018
Last Update: Apr 27, 2025
Category: ---------------
All-Time Rating:
3 ratings
Find more info at github.com...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings