Skip to content

Introduce 'value' alias for 'attribute' in @AliasFor [SPR-13289] #17879

Closed
@spring-projects-issues

Description

@spring-projects-issues

Sam Brannen opened SPR-13289 and commented

Status Quo

#16137 introduced support for annotation attribute aliases via @AliasFor. For example, this support allows @ContextConfiguration from the spring-test module to declare aliases as follows:

public @interface ContextConfiguration {

     @AliasFor(attribute = "locations")
     String[] value() default {};

     @AliasFor(attribute = "value")
     String[] locations() default {};

    // ...
}

For greater readability, it would be beneficial to be able to omit the attribute = "..." declaration by providing a value alias for attribute.

Deliverables

  1. Introduce a value alias for attribute in @AliasFor.

Affects: 4.2 RC1

Issue Links:

Referenced from: commits 7252920, 1c8ac2b

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions