Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce Annotation Redundency #48

Open
Sparky983 opened this issue Feb 28, 2024 · 0 comments
Open

Reduce Annotation Redundency #48

Sparky983 opened this issue Feb 28, 2024 · 0 comments
Labels
feature API additions proposal To propose features that aren't fully fleshed out (and may be dropped)
Milestone

Comments

@Sparky983
Copy link
Owner

Sparky983 commented Feb 28, 2024

Motivation

Writing

@Property("foo")
String foo();

@Property("bar")
String bar();

and (soon)

String baz(@Placeholder("foo") String foo, @Placeholder.Parsed("bar") String bar);

are both extremely verbose.

Proposal

If no annotation (or name for @Placeholder) is present, default to the method/parameter name. If parameters were not compiled, we should throw an error rather than using param1 as that is almost never intentional.

With these changes you should be able to write:

String foo();

@Property // - maybe like this? probably not because it doesn't really aid readability too much
String bar();

String baz(@Placeholder String foo, @Placeholder.Parsed String bar);

Considerations

Should names be mapped in any way? For example into kebab-case? - or should this be something that configuration sources handle (for example through a MappingConfigurationSource?

@Sparky983 Sparky983 added feature API additions proposal To propose features that aren't fully fleshed out (and may be dropped) labels Feb 28, 2024
@Sparky983 Sparky983 added this to the 0.2 milestone Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature API additions proposal To propose features that aren't fully fleshed out (and may be dropped)
Projects
None yet
Development

No branches or pull requests

1 participant