diff --git a/spring-context/src/main/java/org/springframework/stereotype/Controller.java b/spring-context/src/main/java/org/springframework/stereotype/Controller.java index 189776d444..7cba6620e7 100644 --- a/spring-context/src/main/java/org/springframework/stereotype/Controller.java +++ b/spring-context/src/main/java/org/springframework/stereotype/Controller.java @@ -22,6 +22,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.springframework.core.annotation.AliasFor; + /** * Indicates that an annotated class is a "Controller" (e.g. a web controller). * @@ -48,6 +50,7 @@ public @interface Controller { * to be turned into a Spring bean in case of an autodetected component. * @return the suggested component name, if any */ + @AliasFor(annotation = Component.class) String value() default ""; } diff --git a/spring-context/src/main/java/org/springframework/stereotype/Repository.java b/spring-context/src/main/java/org/springframework/stereotype/Repository.java index e69d94466c..7262609319 100644 --- a/spring-context/src/main/java/org/springframework/stereotype/Repository.java +++ b/spring-context/src/main/java/org/springframework/stereotype/Repository.java @@ -22,6 +22,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.springframework.core.annotation.AliasFor; + /** * Indicates that an annotated class is a "Repository", originally defined by * Domain-Driven Design (Evans, 2003) as "a mechanism for encapsulating storage, @@ -64,6 +66,7 @@ public @interface Repository { * to be turned into a Spring bean in case of an autodetected component. * @return the suggested component name, if any */ + @AliasFor(annotation = Component.class) String value() default ""; } diff --git a/spring-context/src/main/java/org/springframework/stereotype/Service.java b/spring-context/src/main/java/org/springframework/stereotype/Service.java index 0930738396..032411dd6d 100644 --- a/spring-context/src/main/java/org/springframework/stereotype/Service.java +++ b/spring-context/src/main/java/org/springframework/stereotype/Service.java @@ -22,6 +22,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; +import org.springframework.core.annotation.AliasFor; + /** * Indicates that an annotated class is a "Service", originally defined by Domain-Driven * Design (Evans, 2003) as "an operation offered as an interface that stands alone in the @@ -50,6 +52,7 @@ public @interface Service { * to be turned into a Spring bean in case of an autodetected component. * @return the suggested component name, if any */ + @AliasFor(annotation = Component.class) String value() default ""; }