diff --git a/core-common/src/main/java/org/mapstruct/DecoratedWith.java b/core-common/src/main/java/org/mapstruct/DecoratedWith.java index 095fdccf8..2f3dcf0fd 100644 --- a/core-common/src/main/java/org/mapstruct/DecoratedWith.java +++ b/core-common/src/main/java/org/mapstruct/DecoratedWith.java @@ -89,13 +89,14 @@ import java.lang.annotation.Target; *

Referencing the original mapper in the decorator

*

* The generated implementation of the original mapper is annotated with the Spring annotation - * {@code @Qualifier("delegate")}. To autowire that bean in your decorator, add that qualifier annotation as well: + * {@code @org.springframework.beans.factory.annotation.Qualifier("delegate")}. To autowire that bean in your decorator, + * add that qualifier annotation as well: * *

  * public abstract class PersonMapperDecorator implements PersonMapper {
  *
  *     @Autowired
- *     @Qualifier("delegate")
+ *     @org.springframework.beans.factory.annotation.Qualifier("delegate")
  *     private PersonMapper delegate;
  *
  *     @Override
@@ -122,16 +123,16 @@ import java.lang.annotation.Target;
  * 

Referencing the original mapper

*

* JSR 330 doesn't specify qualifiers and only allows to specifically name the beans. Hence, the generated - * implementation of the original mapper is annotated with {@code @Named("fully-qualified-name-of-generated-impl")} - * and {@code @Singleton} (please note that when using a decorator, the class name of the mapper implementation ends - * with an underscore). To inject that bean in your decorator, add the same annotation to the delegate field (e.g. by - * copy/pasting it from the generated class): + * implementation of the original mapper is annotated with + * {@code @javax.inject.Named("fully-qualified-name-of-generated-impl")} and {@code @Singleton} (please note that when + * using a decorator, the class name of the mapper implementation ends with an underscore). To inject that bean in your + * decorator, add the same annotation to the delegate field (e.g. by copy/pasting it from the generated class): * *

  * public abstract class PersonMapperDecorator implements PersonMapper {
  *
  *     @Inject
- *     @Named("org.examples.PersonMapperImpl_")
+ *     @javax.inject.Named("org.examples.PersonMapperImpl_")
  *     private PersonMapper delegate;
  *
  *     @Override
@@ -147,12 +148,12 @@ import java.lang.annotation.Target;
  * 

Using the decorated mapper in the decorator

*

* Unlike with the other component models, the usage site must be aware if a mapper is decorated or not, as for - * decorated mappers, the parameterless {@code @Named} annotation must be added to select the decorator to be - * injected: + * decorated mappers, the parameterless {@code @javax.inject.Named} annotation must be added to select the + * decorator to be injected: * *

  * @Inject
- * @Named
+ * @javax.inject.Named
  * private PersonMapper personMapper; // injects the decorator, with the injected original mapper
  * 
*

diff --git a/core-common/src/main/java/org/mapstruct/Mapper.java b/core-common/src/main/java/org/mapstruct/Mapper.java index 6428cb114..34bdf9ae7 100644 --- a/core-common/src/main/java/org/mapstruct/Mapper.java +++ b/core-common/src/main/java/org/mapstruct/Mapper.java @@ -74,7 +74,7 @@ public @interface Mapper { * {@code spring}: the generated mapper is a Spring bean and * can be retrieved via {@code @Autowired} *

  • - * {@code jsr330}: the generated mapper is annotated with {@code @Named} and + * {@code jsr330}: the generated mapper is annotated with {@code @javax.inject.Named} and * {@code @Singleton}, and can be retrieved via {@code @Inject}
  • * * The method overrides an unmappedTargetPolicy set in a central configuration set diff --git a/core-common/src/main/java/org/mapstruct/MapperConfig.java b/core-common/src/main/java/org/mapstruct/MapperConfig.java index d6a2ad243..1a471a1f7 100644 --- a/core-common/src/main/java/org/mapstruct/MapperConfig.java +++ b/core-common/src/main/java/org/mapstruct/MapperConfig.java @@ -76,7 +76,7 @@ public @interface MapperConfig { * {@code spring}: the generated mapper is a Spring bean and * can be retrieved via {@code @Autowired} *
  • - * {@code jsr330}: the generated mapper is annotated with {@code @Named} and + * {@code jsr330}: the generated mapper is annotated with {@code @javax.inject.Named} and * {@code @Singleton}, and can be retrieved via {@code @Inject}
  • * *