-
public interface InjectionPoint
Provides access to metadata about an injection point. May represent an injected field or a parameter of a bean constructor, initializer method, producer method, disposer method or observer method.
If the injection point is a dynamically selected reference obtained then the metadata obtain reflects the injection point of the
Instance
, with the required type and any additional required qualifers defined by Instance.select().Occasionally, a bean with scope
@Dependent
needs to access metadata relating to the object to which it belongs. The bean may inject anInjectionPoint
representing the injection point into which the bean was injected.For example, the following producer method creates injectable Logger s. The log category of a Logger depends upon the class of the object into which it is injected.
@Produces Logger createLogger(InjectionPoint injectionPoint) { return Logger.getLogger(injectionPoint.getMember().getDeclaringClass().getName()); }
Only dependent objects, may obtain information about the injection point to which they belong.
- Author:
- Gavin King, Pete Muir
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description Annotated
getAnnotated()
Obtain an instance ofAnnotatedField
orAnnotatedParameter
, depending upon whether the injection point is an injected field or a constructor/method parameter.Bean<?>
getBean()
Get theBean
object representing the bean that defines the injection point.Member
getMember()
Get theField
object in the case of field injection, theMethod
object in the case of method parameter injection or theConstructor
object in the case of constructor parameter injection.Set<Annotation>
getQualifiers()
Get the required qualifiers of the injection point.Type
getType()
Get the required type of injection point.boolean
isDelegate()
Determines if the injection point is a decorator delegate injection point.boolean
isTransient()
Determines if the injection is a transient field.
-
-
-
Method Detail
-
getType
Type getType()
Get the required type of injection point.- Returns:
- the required type
-
getQualifiers
Set<Annotation> getQualifiers()
Get the required qualifiers of the injection point.- Returns:
- the required qualifiers
-
getBean
Bean<?> getBean()
Get theBean
object representing the bean that defines the injection point. If the injection point does not belong to a bean, return a null value.- Returns:
- the
Bean
object representing bean that defines the injection point, of null if the injection point does not belong to a bean
-
getMember
Member getMember()
Get theField
object in the case of field injection, theMethod
object in the case of method parameter injection or theConstructor
object in the case of constructor parameter injection.- Returns:
- the member
-
getAnnotated
Annotated getAnnotated()
Obtain an instance ofAnnotatedField
orAnnotatedParameter
, depending upon whether the injection point is an injected field or a constructor/method parameter.- Returns:
- an
AnnotatedField
orAnnotatedParameter
-
isDelegate
boolean isDelegate()
Determines if the injection point is a decorator delegate injection point.- Returns:
- true if the injection point is a decorator delegate injection point, and false otherwise
-
isTransient
boolean isTransient()
Determines if the injection is a transient field.- Returns:
- true if the injection point is a transient field, and false otherwise
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/enterprise/inject/spi/InjectionPoint.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.