Interface BeanInfo
-
- All Known Subinterfaces:
InterceptorInfo
public interface BeanInfoBeans are:- managed beans
- beans defined by producer methods
- beans defined by producer fields
- synthetic 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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default InterceptorInfoasInterceptor()Returns this bean as an interceptor.jakarta.enterprise.lang.model.declarations.ClassInfodeclaringClass()Returns the class that declares this bean.DisposerInfodisposer()Returns the disposer method of this producer-based bean.java.util.Collection<InjectionPointInfo>injectionPoints()Returns a collection of this bean's injection points.booleanisAlternative()Returns whether this bean is an alternative.booleanisClassBean()Returns whether this bean is a managed bean, also known as class-based bean.default booleanisInterceptor()Returns whether this bean is an interceptor.booleanisProducerField()Returns whether this bean is defined by a producer field.booleanisProducerMethod()Returns whether this bean is defined by a producer method.booleanisSynthetic()Returns whether this bean is synthetic.java.lang.Stringname()Returns the bean name of this bean.java.lang.Integerpriority()Returns the priority declared on this bean, ornullif this bean does not declare a priority.jakarta.enterprise.lang.model.declarations.FieldInfoproducerField()Returns the producer field that defines this bean.jakarta.enterprise.lang.model.declarations.MethodInfoproducerMethod()Returns the producer method that defines this bean.java.util.Collection<jakarta.enterprise.lang.model.AnnotationInfo>qualifiers()Returns a collection of this bean's qualifiers, represented asAnnotationInfo.ScopeInfoscope()Returns the scope of this bean.java.util.Collection<StereotypeInfo>stereotypes()Returns a collection of this bean's stereotypes.java.util.Collection<jakarta.enterprise.lang.model.types.Type>types()Returns a collection of all types of this bean.
-
-
-
Method Detail
-
types
java.util.Collection<jakarta.enterprise.lang.model.types.Type> types()
Returns a collection of all types of this bean.- Returns:
- immutable collection of bean types, never
null
-
qualifiers
java.util.Collection<jakarta.enterprise.lang.model.AnnotationInfo> qualifiers()
Returns a collection of this bean's qualifiers, represented asAnnotationInfo.- Returns:
- immutable collection of qualifiers, never
null
-
declaringClass
jakarta.enterprise.lang.model.declarations.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. Returnsnullif this bean is synthetic.- Returns:
ClassInfofor the class that declares this bean, ornullif this bean is synthetic
-
isClassBean
boolean isClassBean()
Returns whether this bean is a managed bean, also known as class-based bean.- Returns:
- whether this bean is a managed bean
-
isProducerMethod
boolean isProducerMethod()
Returns whether this bean is defined by a producer method.- Returns:
- whether this bean is defined by a producer method
-
isProducerField
boolean isProducerField()
Returns whether this bean is defined by a producer field.- Returns:
- whether this bean is defined by a producer field
-
isSynthetic
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:
- whether this bean is synthetic
-
producerMethod
jakarta.enterprise.lang.model.declarations.MethodInfo producerMethod()
Returns the producer method that defines this bean. Returnsnullif this bean is not defined by a producer method.- Returns:
- producer method that defines this bean, or
nullif this bean is not defined by a producer method
-
producerField
jakarta.enterprise.lang.model.declarations.FieldInfo producerField()
Returns the producer field that defines this bean. Returnsnullif this bean is not defined by a producer field.- Returns:
- producer field that defines this bean, or
nullif this bean is not defined by a producer field
-
isAlternative
boolean isAlternative()
Returns whether this bean is an alternative.- Returns:
- whether this bean is an alternative
-
priority
java.lang.Integer priority()
Returns the priority declared on this bean, ornullif 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:
- the priority of this bean, or
nullif this bean does not declare a priority
-
name
java.lang.String name()
Returns the bean name of this bean. A bean name is usually defined using the@Namedannotation. Returnsnullif the bean does not have a name.- Returns:
- the bean name, or
nullif the bean does not have a name
-
disposer
DisposerInfo disposer()
Returns the disposer method of this producer-based bean. Returnsnullif 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:
- the disposer, or
nullif this bean does not have a disposer
-
stereotypes
java.util.Collection<StereotypeInfo> stereotypes()
Returns a collection of this bean's stereotypes.- Returns:
- immutable collection of stereotypes, never
null
-
injectionPoints
java.util.Collection<InjectionPointInfo> injectionPoints()
Returns a collection of this bean's injection points.- Returns:
- immutable collection of injection points, never
null
-
isInterceptor
default boolean isInterceptor()
Returns whether this bean is an interceptor.- Returns:
- whether this bean is an interceptor
-
asInterceptor
default InterceptorInfo asInterceptor()
Returns this bean as an interceptor.- Returns:
- this interceptor, never
null - Throws:
java.lang.IllegalStateException- ifisInterceptor()returnsfalse
-
-