-
- All Known Subinterfaces:
InterceptorInfo
public interface BeanInfo
Beans 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 InterceptorInfo
asInterceptor()
Returns this bean as an interceptor.ClassInfo
declaringClass()
Returns the class that declares this bean.DisposerInfo
disposer()
Returns the disposer method of this producer-based bean.java.util.Collection<InjectionPointInfo>
injectionPoints()
Returns a collection of this bean's injection points.boolean
isAlternative()
Returns whether this bean is an alternative.boolean
isClassBean()
Returns whether this bean is a managed bean, also known as class-based bean.default boolean
isInterceptor()
Returns whether this bean is an interceptor.boolean
isProducerField()
Returns whether this bean is defined by a producer field.boolean
isProducerMethod()
Returns whether this bean is defined by a producer method.boolean
isSynthetic()
Returns whether this bean is synthetic.java.lang.String
name()
Returns the bean name of this bean.java.lang.Integer
priority()
Returns the priority declared on this bean, ornull
if this bean does not declare a priority.FieldInfo
producerField()
Returns the producer field that defines this bean.MethodInfo
producerMethod()
Returns the producer method that defines this bean.java.util.Collection<AnnotationInfo>
qualifiers()
Returns a collection of this bean's qualifiers, represented asAnnotationInfo
.ScopeInfo
scope()
Returns the scope of this bean.java.util.Collection<StereotypeInfo>
stereotypes()
Returns a collection of this bean's stereotypes.java.util.Collection<Type>
types()
Returns a collection of all types of this bean.
-
-
-
Method Detail
-
types
java.util.Collection<Type> types()
Returns a collection of all types of this bean.- Returns:
- immutable collection of bean types, never
null
-
qualifiers
java.util.Collection<AnnotationInfo> qualifiers()
Returns a collection of this bean's qualifiers, represented asAnnotationInfo
.- Returns:
- immutable collection of qualifiers, never
null
-
declaringClass
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. Returnsnull
if this bean is synthetic.- Returns:
ClassInfo
for the class that declares this bean, ornull
if 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
MethodInfo producerMethod()
Returns the producer method that defines this bean. Returnsnull
if this bean is not defined by a producer method.- Returns:
- producer method that defines this bean, or
null
if this bean is not defined by a producer method
-
producerField
FieldInfo producerField()
Returns the producer field that defines this bean. Returnsnull
if this bean is not defined by a producer field.- Returns:
- producer field that defines this bean, or
null
if 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, ornull
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:
- the priority of this bean, or
null
if 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@Named
annotation. Returnsnull
if the bean does not have a name.- Returns:
- the bean name, or
null
if the bean does not have a name
-
disposer
DisposerInfo disposer()
Returns the disposer method of this producer-based bean. Returnsnull
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:
- the disposer, or
null
if 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
-
-