Closed anonymous123-code closed 6 months ago
please run applyLicenses
!
Should the metadata when applied using the builder also be inherited? I think so and then a new API for inherited metadata might be a good idea.
@anonymous123-code I'm not sure what you mean by that, can you elaborate?
Currently, only the annotations are propagated to children (A annotated config will set defaults for all properties and sections it contains etc.), but if I add metadata using the builder that is not propagated. This means that only the ReflectiveConfig can use that shortcut. I think it would be better if there was a type of metadata that gets propagated to children, even if added through the builder. This would imply some new API stuff and widen the scope of this PR
@anonymous123-code any plans to finish this?
This is now ready for review again. Quite a lot of stuff changed; and I updated the PR description
Metadata types can be made inhertitable by using true in the create methods (There are overloads defaulting to false) When the config builder is finally built, all inheritable metadata is propagated and applied to its children. If children specify their own metadata, that takes precedence.
Additionally makes it so that ConfigFieldAnnotationProcessors can also process the config class's annotations.
Specific to SerializedNameConvention
NamingScheme
interface and theNamingSchemes
enum, inspired by Configurate, but more flexible to prepare for #30NameConvention.custom()
andNameConvention.value()
can be set at the same time, butNameConvention.custom()
takes priority.NameConvention
by default.NameConventions
for their nested values. ANameConvention
annotation to the section field, with the annotation on the field taking priority.PASSTHROUGH
, for backwards compatibility.Based on #4 Fixes #29