Commit Graph

74 Commits (dc010a01f1580de551c875455e0b2dbfe687437e)
 

Author SHA1 Message Date
Alisson Lopes dc010a01f1
Window Test Support (#25)
* 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
1 year ago
Exlll ba79c08b07 Improve documentation 2 years ago
Exlll f6e12de95a Update version to 4.2.0
**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.
2 years ago
Exlll 0eb73815be Add miscellaneous test cases 2 years ago
Exlll 268ce78163 Improve documentation
Among other things, document Polymorphic and PolymorphicTypes
annotations in README.
2 years ago
Exlll 482e9464a9 Add PolymorphicTypes annotation
This annotation can be used to provide type aliases for subtypes which
are then used instead of Java class names.
2 years ago
Exlll 9f4999c726 Add support for polymorphic serialization
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.
2 years ago
Exlll 30430527a1 Allow SerializeWith (meta-)annotation on types 2 years ago
Exlll 37ad956d8e Add 'addSerializerFactory' method to properties
The factory method gives access to a SerializerContext object which is
not accessible if 'addSerializer' is used.
2 years ago
Exlll f0c76d5c5a Add documentation about SerializeWith and SerializerContext 2 years ago
Exlll eaccf30d5e Rename TypeComponent to ConfigurationElement and refactor it
This commit also introduces the term "configuration element" to refer to
either a class field or record component of a configuration type.
2 years ago
Exlll bb58025239 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 serializer classes define such a constructor.
2 years ago
Exlll c78f4b2901 Change TypeComponent and SerializerSelector to use AnnotatedType 2 years ago
Exlll 1c38f85177 Refactor SerializerSelectorTest 2 years ago
Exlll 96321dd682 Add support for SerializeWith annotation 2 years ago
Exlll 0a291fe922 Move SerializerMapper functionality to TypeSerializer 2 years ago
Exlll 3c25327f7f Refactor TypeComponent 2 years ago
Exlll 7ce9c6b1c6 Add componentGenericType to TypeComponent 2 years ago
Exlll 48aef6a48c Let generic type of TypeComponent extend AnnotatedElement 2 years ago
Exlll 0f3656a21b Update version to 4.1.0
* Added jitpack.io support (by @RobotHanzo)
* Added two new NameFormatters (by @Insprill)
  - LOWER_KEBAB_CASE
  - UPPER_KEBAB_CASE
* Fixed handling of comments that contain newlines (by @Insprill)
2 years ago
Exlll e1dcacb1a1 Update documentation 2 years ago
Pierce Thompson ce87129094
Properly handle multi-line comments split with the newline character (#17)
* Properly handle multi-line comments split with the newline character
* Don't discard trailing newlines
* Add unit tests
2 years ago
Pierce Thompson 26dfd4d6b5
Add kebab-case name formatters (#16) 2 years ago
RobotHanzo 54762f8bb5
Support building with jitpack (#13) 2 years ago
Exlll bfbda2f629 Update version to 4.0.0
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
2 years ago
Exlll d1acb875c2 Remove update with default configuration.
Default values for Records can now be provided through constructors
that have no parameters.
2 years ago
Exlll 5b9c7754b4 Move to new project structure 2 years ago
Exlll bff27c06b1 Allow calls to update with a default configuration 2 years ago
Exlll 6ee99ff619 Update documentation for Records 2 years ago
Exlll e5028e6199 Add top-level saving/loading support for Records
Records can now be saved and loaded directly using one of the several
methods available.

Also, the TypeSerializer has been refactored.
2 years ago
Exlll a2153106b5 Add support for Record component comments 2 years ago
Exlll 7e79597cdd Add support for Record serialization 2 years ago
Exlll 31748db01b Add support for Instant, File, Path, URL, and URI 2 years ago
Exlll 5216a889af
Update issue templates 2 years ago
Exlll 3112ea1bce Update version to 3.1.0 2 years ago
Exlll 57a9b33673 Add UUID serializer 2 years ago
Exlll c2c35daab2 Add documantation about ConfigurationSerializable support 2 years ago
Exlll 3ea01199db Add serialization support for Bukkit's ConfigurationSerializable types 2 years ago
Exlll f70c44f159 Add toBuilder method to create a builder from a properties object 2 years ago
Exlll 7c4f630f7c ConfigLib v3 2 years ago
Exlll 65555f7dd6 Publish on master push, update "Import" README section 3 years ago
Exlll 84f38cdc71 Migrate build scripts to Kotlin DSL. 3 years ago
Exlll b047ddcb6e Add Github action to test on PR or on a push to "dev" 3 years ago
Exlll 445e39f8ae Update Gradle to version 7.1 3 years ago
Exlll 38b1a1aca4 Added @Format annotation
This 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
6 years ago
Exlll 58b81f3314 Added FieldFilter
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:

YamlProperties properties = YamlProperties.builder()
                .addFilter(field -> !field.getName().startsWith("ignore"))
                // ...
                .build();
6 years ago
Exlll b8caedc86d Fix: Converting back fails for nested collections of complex ConfigurationElements
Note that you now have to set a nesting level when using nested
collections that require the ElementType annotation.
6 years ago
Exlll ee53d0c609 Fix: Comments not saved if FieldNameFormatter is used 6 years ago
Exlll 9681114e69
Create LICENSE 6 years ago
Exlll 7f600834ff Improve documentation 6 years ago