Skip to content

Allow meta-annotations to override attributes from their parent [SPR-10181] #14814

Closed

Description

@spring-projects-issues

Dave Syer opened SPR-10181 and commented

Allow meta-annotations to override attributes from their parent. Example: Spring Batch 2.2 defines

@Scope(value = "step", proxyMode = INTERFACES)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface StepScope {
}

But if the user needs to have proxyMode = TARGET_CLASS (which is quite common) he has to define his own meta-annotation, or use @Scope. It would be nice if we could do this:

@Scope(value = "step")
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface StepScope {
        ScopedProxyMode proxyMode() default ScopedProxyMode.INTERFACES;
}

and have the default value picked up as well as any explicit overrides by users of the new annotation.


Issue Links:

Referenced from: commits f2fb0ec, 6d36498

1 votes, 4 watchers

Activity

  1. spring-projects-issues commented on Aug 21, 2013

    @spring-projects-issues
    CollaboratorAuthor

    Juergen Hoeller commented

    Finally supported for all of our composable annotations: including @Scope, @Bean, @Autowired and @Transactional.

    Juergen

  2. added
    type: enhancement
    in: core
    on Jan 11, 2019
  3. added this to the 4.0 M3 milestone on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coretype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions