Closed zeroeightysix closed 4 years ago
I think it would be a good idea to do the transient
and Ignored
checks in this class. Would remove some hardcoding in AnnotatedSettings
.
Is it really useful to make a subpackage for just 2 new classes ? I think MemberCollector
could go in the base annotation package, while SettingProcessor
could go to the existing processor
subpackage. Maybe SettingProcessor
could be renamed too ? Something like PojoMemberProcessor
?
Generally, I try to organise features per-package, and in this case not to clutter the io.github.fablabsmc.fablabs.api.fiber.v1.annotation
package with unrelated classes. If you feel strongly about not keeping it this way, feel free to change it however.
PojoMemberProcessor
probably does describe the class better.
This PR adds an interface
MemberCollector
which is in charge of collecting the set of fields or methods from aClass<?>
that will be processed byAnnotatedSettings
.This allows
AnnotatedSettings
to also look at the fields in superclasses, or allows users to artificially ignore fields. It may be useful to avoid repetition in config POJOs (think of e.g. a list of modules that all have an 'enabled' property).Another thought is to also offload the logic for ignoring fields/methods to the
MemberCollector
. This way we can extend the recursiveMemberCollector
to also look at@Settings
annotations on superclasses.