Skip to content

Reduce Annotation Redundency #48

@Sparky983

Description

@Sparky983

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureAPI additionsproposalTo propose features that aren't fully fleshed out (and may be dropped)

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions