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.
dev v4.2.0
Exlll 2 years ago
parent 0eb73815be
commit f6e12de95a

@ -862,7 +862,7 @@ with `configlib-paper` (see [here](#support-for-bukkit-classes-like-itemstack)).
<dependency> <dependency>
<groupId>com.github.Exlll.ConfigLib</groupId> <groupId>com.github.Exlll.ConfigLib</groupId>
<artifactId>configlib-yaml</artifactId> <artifactId>configlib-yaml</artifactId>
<version>v4.1.0</version> <version>v4.2.0</version>
</dependency> </dependency>
``` ```
@ -871,13 +871,13 @@ with `configlib-paper` (see [here](#support-for-bukkit-classes-like-itemstack)).
```groovy ```groovy
repositories { maven { url 'https://jitpack.io' } } repositories { maven { url 'https://jitpack.io' } }
dependencies { implementation 'com.github.Exlll.ConfigLib:configlib-yaml:v4.1.0' } dependencies { implementation 'com.github.Exlll.ConfigLib:configlib-yaml:v4.2.0' }
``` ```
```kotlin ```kotlin
repositories { maven { url = uri("https://jitpack.io") } } repositories { maven { url = uri("https://jitpack.io") } }
dependencies { implementation("com.github.Exlll.ConfigLib:configlib-yaml:v4.1.0") } dependencies { implementation("com.github.Exlll.ConfigLib:configlib-yaml:v4.2.0") }
``` ```
</details> </details>
@ -901,7 +901,7 @@ this [issue](https://github.com/Exlll/ConfigLib/issues/12) if you have any troub
<dependency> <dependency>
<groupId>de.exlll</groupId> <groupId>de.exlll</groupId>
<artifactId>configlib-yaml</artifactId> <artifactId>configlib-yaml</artifactId>
<version>4.1.0</version> <version>4.2.0</version>
</dependency> </dependency>
``` ```
@ -910,13 +910,13 @@ this [issue](https://github.com/Exlll/ConfigLib/issues/12) if you have any troub
```groovy ```groovy
repositories { maven { url 'https://maven.pkg.github.com/Exlll/ConfigLib' } } repositories { maven { url 'https://maven.pkg.github.com/Exlll/ConfigLib' } }
dependencies { implementation 'de.exlll:configlib-yaml:4.1.0' } dependencies { implementation 'de.exlll:configlib-yaml:4.2.0' }
``` ```
```kotlin ```kotlin
repositories { maven { url = uri("https://maven.pkg.github.com/Exlll/ConfigLib") } } repositories { maven { url = uri("https://maven.pkg.github.com/Exlll/ConfigLib") } }
dependencies { implementation("de.exlll:configlib-yaml:4.1.0") } dependencies { implementation("de.exlll:configlib-yaml:4.2.0") }
``` ```
</details> </details>

@ -1,4 +1,4 @@
allprojects { allprojects {
group = "de.exlll" group = "de.exlll"
version = "4.1.0" version = "4.2.0"
} }

@ -23,13 +23,13 @@ repositories {
} }
dependencies { dependencies {
testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.8.2") testFixturesApi("org.junit.jupiter:junit-jupiter-api:5.9.0")
testFixturesApi("org.junit.jupiter:junit-jupiter-params:5.8.2") testFixturesApi("org.junit.jupiter:junit-jupiter-params:5.9.0")
testFixturesApi("org.junit.jupiter:junit-jupiter-engine:5.8.2") testFixturesApi("org.junit.jupiter:junit-jupiter-engine:5.9.0")
testFixturesApi("org.junit.platform:junit-platform-runner:1.8.2") testFixturesApi("org.junit.platform:junit-platform-runner:1.9.0")
testFixturesApi("org.junit.platform:junit-platform-suite-api:1.8.2") testFixturesApi("org.junit.platform:junit-platform-suite-api:1.9.0")
testFixturesApi("org.mockito:mockito-inline:4.2.0") testFixturesApi("org.mockito:mockito-inline:4.7.0")
testFixturesApi("org.mockito:mockito-junit-jupiter:4.2.0") testFixturesApi("org.mockito:mockito-junit-jupiter:4.7.0")
testFixturesApi("org.hamcrest:hamcrest-all:1.3") testFixturesApi("org.hamcrest:hamcrest-all:1.3")
testFixturesApi("com.google.jimfs:jimfs:1.2") testFixturesApi("com.google.jimfs:jimfs:1.2")
} }

@ -1,7 +1,3 @@
plugins { plugins {
`core-config` `core-config`
}
dependencies {
implementation("org.snakeyaml:snakeyaml-engine:2.3")
} }

@ -12,12 +12,11 @@ import java.lang.annotation.Target;
* <pre> * <pre>
* {@code * {@code
* @Polymorphic * @Polymorphic
* @PolymorphicTypes({ * @PolymorphicTypes( {
* @PolymorphicTypes.Type(type = Impl1.class, alias = "IMPL_1"), * @PolymorphicTypes.Type(type = Impl1.class, alias = "IMPL_1"),
* @PolymorphicTypes.Type(type = Impl2.class, alias = "IMPL_2") * @PolymorphicTypes.Type(type = Impl2.class, alias = "IMPL_2")
* } * })
* <code>})</code> *
* {@code
* interface A { ... } * interface A { ... }
* *
* record Impl1(...) implements A { ... } * record Impl1(...) implements A { ... }

@ -1,5 +1,5 @@
name: ConfigLib name: ConfigLib
version: 4.1.0 version: 4.2.0
website: https://github.com/Exlll/ConfigLib website: https://github.com/Exlll/ConfigLib
description: A library for working with YAML configurations. description: A library for working with YAML configurations.
author: Exlll author: Exlll

@ -8,7 +8,7 @@ import com.velocitypowered.api.plugin.Plugin;
@Plugin( @Plugin(
id = "configlib", id = "configlib",
name = "ConfigLib", name = "ConfigLib",
version = "4.1.0", version = "4.2.0",
url = "https://github.com/Exlll/ConfigLib", url = "https://github.com/Exlll/ConfigLib",
description = "A library for working with YAML configurations.", description = "A library for working with YAML configurations.",
authors = {"Exlll"} authors = {"Exlll"}

@ -1,5 +1,5 @@
name: ConfigLib name: ConfigLib
version: 4.1.0 version: 4.2.0
website: https://github.com/Exlll/ConfigLib website: https://github.com/Exlll/ConfigLib
description: A library for working with YAML configurations. description: A library for working with YAML configurations.
author: Exlll author: Exlll

Loading…
Cancel
Save