Top Description Methods
jakarta.enterprise.inject.build.compatible.spi

public Interface BeanInfo

Known Direct Subinterfaces
jakarta.enterprise.inject.build.compatible.spi.InterceptorInfo
Imports
java.util.Collection, jakarta.enterprise.lang.model.AnnotationInfo, jakarta.enterprise.lang.model.declarations.ClassInfo, .FieldInfo, .MethodInfo, jakarta.enterprise.lang.model.types.Type

Beans are: Managed beans are also known as class-based beans, while beans defined by producer methods and producer fields are together also known as producer-based beans.

Class-based and producer-based beans directly correspond to a declaration in program source code. Synthetic beans don't and are instead defined through other mechanisms, such as extensions.

Since
4.0

Method Summary

Modifier and TypeMethod and Description
public default InterceptorInfo

Returns:

this interceptor, never null
asInterceptor
()

Returns this bean as an interceptor.

public ClassInfo

Returns:

ClassInfo for the class that declares this bean, or null if this bean is synthetic
declaringClass
()

Returns the class that declares this bean.

public DisposerInfo

Returns:

the disposer, or null if this bean does not have a disposer
disposer
()

Returns the disposer method of this producer-based bean.

public Collection<InjectionPointInfo>

Returns:

immutable collection of injection points, never null
injectionPoints
()

Returns a collection of this bean's injection points.

public boolean

Returns:

whether this bean is an alternative
isAlternative
()

Returns whether this bean is an alternative.

public boolean

Returns:

whether this bean is a managed bean
isClassBean
()

Returns whether this bean is a managed bean, also known as class-based bean.

public default boolean

Returns:

whether this bean is an interceptor
isInterceptor
()

Returns whether this bean is an interceptor.

public boolean

Returns:

whether this bean is defined by a producer field
isProducerField
()

Returns whether this bean is defined by a producer field.

public boolean

Returns:

whether this bean is defined by a producer method
isProducerMethod
()

Returns whether this bean is defined by a producer method.

public boolean

Returns:

whether this bean is synthetic
isSynthetic
()

Returns whether this bean is synthetic.

public String

Returns:

the bean name, or null if the bean does not have a name
name
()

Returns the bean name of this bean.

public Integer

Returns:

the priority of this bean, or null if this bean does not declare a priority
priority
()

Returns the priority declared on this bean, or null if this bean does not declare a priority.

public FieldInfo

Returns:

producer field that defines this bean, or null if this bean is not defined by a producer field
producerField
()

Returns the producer field that defines this bean.

public MethodInfo

Returns:

producer method that defines this bean, or null if this bean is not defined by a producer method
producerMethod
()

Returns the producer method that defines this bean.

public Collection<AnnotationInfo>

Returns:

immutable collection of qualifiers, never null
qualifiers
()

Returns a collection of this bean's qualifiers, represented as AnnotationInfo.

public ScopeInfo

Returns:

the scope of this bean, never null
scope
()

Returns the scope of this bean.

public Collection<StereotypeInfo>

Returns:

immutable collection of stereotypes, never null
stereotypes
()

Returns a collection of this bean's stereotypes.

public Collection<Type>

Returns:

immutable collection of bean types, never null
types
()

Returns a collection of all types of this bean.

Method Detail

asInterceptorback to summary
public default InterceptorInfo asInterceptor()

Returns this bean as an interceptor.

Returns:InterceptorInfo

this interceptor, never null

Exceptions
IllegalStateException:
if isInterceptor() returns false
declaringClassback to summary
public ClassInfo declaringClass()

Returns the class that declares this bean. In case of a managed bean, also known as class-based bean, that is the bean class directly. In case of a producer method or field, that is the class that declares the producer method or field. Returns null if this bean is synthetic.

Returns:ClassInfo

ClassInfo for the class that declares this bean, or null if this bean is synthetic

disposerback to summary
public DisposerInfo disposer()

Returns the disposer method of this producer-based bean. Returns null if this bean is not a defined by a producer method or a producer field, or if this producer-based bean does not have a corresponding disposer method.

Returns:DisposerInfo

the disposer, or null if this bean does not have a disposer

injectionPointsback to summary
public Collection<InjectionPointInfo> injectionPoints()

Returns a collection of this bean's injection points.

Returns:Collection<InjectionPointInfo>

immutable collection of injection points, never null

isAlternativeback to summary
public boolean isAlternative()

Returns whether this bean is an alternative.

Returns:boolean

whether this bean is an alternative

isClassBeanback to summary
public boolean isClassBean()

Returns whether this bean is a managed bean, also known as class-based bean.

Returns:boolean

whether this bean is a managed bean

isInterceptorback to summary
public default boolean isInterceptor()

Returns whether this bean is an interceptor.

Returns:boolean

whether this bean is an interceptor

isProducerFieldback to summary
public boolean isProducerField()

Returns whether this bean is defined by a producer field.

Returns:boolean

whether this bean is defined by a producer field

isProducerMethodback to summary
public boolean isProducerMethod()

Returns whether this bean is defined by a producer method.

Returns:boolean

whether this bean is defined by a producer method

isSyntheticback to summary
public boolean isSynthetic()

Returns whether this bean is synthetic. In other words, whether this bean does not correspond to a declaration in program source code and was created through other means (e.g. using an extension).

Returns:boolean

whether this bean is synthetic

nameback to summary
public String name()

Returns the bean name of this bean. A bean name is usually defined using the @Named annotation. Returns null if the bean does not have a name.

Returns:String

the bean name, or null if the bean does not have a name

priorityback to summary
public Integer priority()

Returns the priority declared on this bean, or null if this bean does not declare a priority. Declaring a priority on an alternative bean makes it an enabled alternative. Similarly, declaring a priority on an interceptor makes it an enabled interceptor.

Returns:Integer

the priority of this bean, or null if this bean does not declare a priority

producerFieldback to summary
public FieldInfo producerField()

Returns the producer field that defines this bean. Returns null if this bean is not defined by a producer field.

Returns:FieldInfo

producer field that defines this bean, or null if this bean is not defined by a producer field

producerMethodback to summary
public MethodInfo producerMethod()

Returns the producer method that defines this bean. Returns null if this bean is not defined by a producer method.

Returns:MethodInfo

producer method that defines this bean, or null if this bean is not defined by a producer method

qualifiersback to summary
public Collection<AnnotationInfo> qualifiers()

Returns a collection of this bean's qualifiers, represented as AnnotationInfo.

Returns:Collection<AnnotationInfo>

immutable collection of qualifiers, never null

scopeback to summary
public ScopeInfo scope()

Returns the scope of this bean.

Returns:ScopeInfo

the scope of this bean, never null

stereotypesback to summary
public Collection<StereotypeInfo> stereotypes()

Returns a collection of this bean's stereotypes.

Returns:Collection<StereotypeInfo>

immutable collection of stereotypes, never null

typesback to summary
public Collection<Type> types()

Returns a collection of all types of this bean.

Returns:Collection<Type>

immutable collection of bean types, never null