* feat: Make read/write charset configurable, default to UTF-8
* refactor: Make charset final in FileConfigurationProperties
* test: add unit tests
* refactor: use system/environment encoding by default
* test: fix spacing in test class
* test: removed unused import
* 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.
This commit adds the new interface IOStreamConfigurationStore that provides two
new methods, one for reading configurations from InputStreams and a second
for writing configurations to OutputStreams. This interfaces is implemented
by the YamlConfigurationStore class.
* Windows Test Support - Add helper methods to convert the unix absolute path to the Jimfs's supported Windows path
* Windows Test Support - Bump Jimfs version
* Windows Test Support - Implement helper methods to the needed paths
* Windows Test Support - Implement helper methods to the needed paths and remove the unsupported (on Windows) newline character in the filename
* Windows Test Support - Statically importing the helper methods
* Windows Test Support - Statically importing the helper methods and changing the constant field names to good practices
**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.
This commit adds the Polymorphic annotation 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.
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 serializer classes define such a constructor.
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 lost their -YamlConfiguration affix.
* FieldFormatter has been renamed to NameFormatter