To sum it up:
- A bean may have an EL name (2.5. Bean EL names)
- EL name is declared with the @Named qualifier (2.5. Bean EL names)
- If the @Named annotation does not specify the value member, the EL name is defaulted (2.5. Bean EL names)
- The defaulted name is used in typesafe resolution: "If an injected field declares a @Named annotation that does not specify the value member, the name of the field is assumed." and the qualifier is changed to @Named(DEFAULT_NAME)(3.13. The qualifier @Named at injection points)
- However in case of @Named is used on stereotype only EL name is defaulted
So if I understand it correctly the only clarification required for "2.5. Bean EL names" is: "If a bean declares @Named qualifier and no EL name is explicitly specified, the default EL name is assigned, and the qualifier is @Named(value=DEFAULT_NAME).".
Otherwise a bean with the @Named annotation that does not specify the value member could not be resolved - see example below.
@Named
|
public class Ant {}
|
|
public class AntHill {
|
@Inject
|
@Named // -> @Named("ant") --> UnsatisfiedResolutionException
|
private Ant ant;
|
}
|
To sum it up:
So if I understand it correctly the only clarification required for "2.5. Bean EL names" is: "If a bean declares @Named qualifier and no EL name is explicitly specified, the default EL name is assigned, and the qualifier is @Named(value=DEFAULT_NAME).".
Otherwise a bean with the @Named annotation that does not specify the value member could not be resolved - see example below.
@Namedpublic class Ant {}public class AntHill {@Inject@Named // -> @Named("ant") --> UnsatisfiedResolutionExceptionprivate Ant ant;}