ConfigJSR icon indicating copy to clipboard operation
ConfigJSR copied to clipboard

@ConfigProperty applicable to a TYPE or a METHOD?

Open jeanouii opened this issue 6 years ago • 3 comments

The @ConfigProperty has a target like

@Target({METHOD, FIELD, PARAMETER, TYPE})

Do we currently support METHOD and TYPE? Looks like in most cases, it's for fields.

For version, I would only keep FIELD and PARAMETER that we can easily support

Happy to push a PR if we are ok.

jeanouii avatar Mar 08 '18 15:03 jeanouii

I would say that CONSTRUCTOR and METHOD are more appropriate than TYPE as those two targets would potentially be used by those in a CDI environment.

smoyer64 avatar Apr 16 '18 09:04 smoyer64

Yes, I'm not sure myself why it's TYPE, but TYPE is really cool as it allows us to apply it to interfaces!

In Geronimo-config we used this to implement interface-style config a la Apache DeltaSpike. See https://github.com/eclipse/ConfigJSR/issues/12

struberg avatar May 23 '18 05:05 struberg

We should probably rename it to something else? @Configured for example?

struberg avatar May 24 '18 14:05 struberg