-
@Target(value={TYPE,METHOD}) @Retention(value=RUNTIME) @Documented public @interface Specializes
Indicates that a bean directly specializes another bean. May be applied to a bean class or producer method.
If a bean directly specializes a second bean, it inherits:
- all qualifiers of the second bean, and
- the name, if any, of the second bean.
If the second bean has a name, the bean may not declare a name using
@Named
. Furthermore, the bean must have all the bean types of the second bean.- If a bean class of a managed bean is annotated @Specializes , then the bean class must directly extend the bean class of a second managed bean. Then the first managed bean directly specializes the second managed bean.
- If a bean class of a session bean is annotated @Specializes , then the bean class must directly extend the bean class of a second session bean. Then the first session bean directly specializes the second session bean.
- If a producer method is annotated @Specializes, then it must be non-static and directly override another producer method. Then the first producer method directly specializes the second producer method.
If a bean is specialized by any enabled bean, the first bean is disabled.
- Author:
- Gavin King, Pete Muir
Document created the 11/06/2005, last modified the 18/08/2025
Source of the printed document:https://www.gaudry.be/en/java-api-javaee-rf-javax/enterprise/inject/specializes.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author of this site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.