Skip to content

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

Closed
@spring-projects-issues

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

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