QuiltMC / quilt-config

Quilt Config (aka "haven king's metadata of madness") is a library designed to facilitate the creation and management of config files.
Apache License 2.0
21 stars 8 forks source link

Add SerializedNameConvention annotation and metadata #34

Closed anonymous123-code closed 6 months ago

anonymous123-code commented 7 months ago

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

Based on #4 Fixes #29

ix0rai commented 7 months ago

please run applyLicenses!

anonymous123-code commented 7 months ago

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.

ix0rai commented 7 months ago

@anonymous123-code I'm not sure what you mean by that, can you elaborate?

anonymous123-code commented 7 months ago

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

ix0rai commented 6 months ago

@anonymous123-code any plans to finish this?

anonymous123-code commented 6 months ago

This is now ready for review again. Quite a lot of stuff changed; and I updated the PR description