From what I understand, the features are just arbitrary String values. Groups have an actual PropertyGroupDescriptor that can handle its own metadata.
AFAIU, a `mandatory property group` would make more sense to implement.
As a bonus, all property groups are associated to 0 or 1 feature.
Charpentier Lucas on 27/Feb/25 18:12
In order to implement this functionality, we need to update the `populateBean` method of the DefaultBeanManager. We'll probably need a new Exception type along the lines of "None of the properties for the feature has been set."
My idea on how to implement it:
First we iterate on properties as usual. Do everything regularly but keep traces of the features for Properties that have the `MandatoryFeature` tag.
Iterate on all mandatoryfeatures. For each mandatory feature, we retrieve all the properties that implement this feature, and we check if at least one is set (in most cases, it would also make sense to avoid having more than one implementation at a time for a feature). If none (or more than one) property has a value for this feature, throw a `FeatureMandatoryException`.
I'm not sure I understand everything here, but it looks like a complete solution to me.
Note that implementing things this way would mean that the feature needs only one property tagged with `MandatoryFeature` to be mandatory. IMO it's more lenient than needing a `MandatoryFeature` on all properties using it.
This message was sent by Atlassian Jira (v9.3.0#930000-sha1:287aeb6)
If image attachments aren't displayed, see this article.