Package io.quarkus.arc.processor
Class BeanConfiguratorBase<THIS extends BeanConfiguratorBase<THIS,T>,T>
- java.lang.Object
-
- io.quarkus.arc.processor.ConfiguratorBase<THIS>
-
- io.quarkus.arc.processor.BeanConfiguratorBase<THIS,T>
-
- All Implemented Interfaces:
Consumer<org.jboss.jandex.AnnotationInstance>
- Direct Known Subclasses:
BeanConfigurator
public abstract class BeanConfiguratorBase<THIS extends BeanConfiguratorBase<THIS,T>,T> extends ConfiguratorBase<THIS> implements Consumer<org.jboss.jandex.AnnotationInstance>
This construct is not thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description protected Booleanalternativeprotected Consumer<io.quarkus.gizmo.MethodCreator>creatorConsumerprotected booleandefaultBeanprotected Consumer<io.quarkus.gizmo.MethodCreator>destroyerConsumerprotected booleanforceApplicationClassprotected Stringidentifierprotected org.jboss.jandex.DotNameimplClazzprotected Set<InjectionPointInfo.TypeAndQualifiers>injectionPointsprotected Stringnameprotected Integerpriorityprotected org.jboss.jandex.TypeproviderTypeprotected Set<org.jboss.jandex.AnnotationInstance>qualifiersprotected booleanremovableprotected ScopeInfoscopeprotected List<StereotypeInfo>stereotypesprotected StringtargetPackageNameprotected Set<org.jboss.jandex.Type>types-
Fields inherited from class io.quarkus.arc.processor.ConfiguratorBase
params
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBeanConfiguratorBase(org.jboss.jandex.DotName implClazz)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(org.jboss.jandex.AnnotationInstance qualifier)THISaddInjectionPoint(org.jboss.jandex.Type requiredType, org.jboss.jandex.AnnotationInstance... requiredQualifiers)Adds a synthetic injection point.QualifierConfigurator<THIS>addQualifier()THISaddQualifier(Class<? extends Annotation> annotationClass)THISaddQualifier(org.jboss.jandex.AnnotationInstance qualifier)THISaddQualifier(org.jboss.jandex.DotName annotationName)THISaddStereotype(StereotypeInfo stereotype)THISaddType(Class<?> type)THISaddType(org.jboss.jandex.DotName className)THISaddType(org.jboss.jandex.Type type)THISalternative(boolean alternative)protected static <T> Tcast(Object obj)<U extends T>
THIScreator(Class<? extends BeanCreator<U>> creatorClazz)THIScreator(Consumer<io.quarkus.gizmo.MethodCreator> methodCreatorConsumer)The first method parameter is the synthetic creational context, i.e.THISdefaultBean()<U extends T>
THISdestroyer(Class<? extends BeanDestroyer<U>> destroyerClazz)THISdestroyer(Consumer<io.quarkus.gizmo.MethodCreator> methodCreatorConsumer)THISforceApplicationClass()Forces the bean to be considered an 'application class', so it will be defined in the runtime ClassLoader and re-created on each redeployment.THISidentifier(String identifier)The identifier becomes part of theBeanInfo.getIdentifier()andInjectableBean.getIdentifier().THISname(String name)THISnamed(String name)Unlike thename(String)method, a newNamedqualifier with the specified value is added to the configured bean.THISpriority(int value)THISproviderType(org.jboss.jandex.Type providerType)The provider type is the "real" type of the bean instance created viaInjectableReferenceProvider.get(CreationalContext).THISqualifiers(org.jboss.jandex.AnnotationInstance... qualifiers)THISread(BeanConfiguratorBase<?,?> base)Read metadata from another configurator base.THISscope(ScopeInfo scope)THISscope(Class<? extends Annotation> scope)THISstereotypes(StereotypeInfo... stereotypes)THIStargetPackageName(String name)THIStypes(Class<?>... types)THIStypes(org.jboss.jandex.Type... types)THISunremovable()-
Methods inherited from class io.quarkus.arc.processor.ConfiguratorBase
param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, param, read, self
-
-
-
-
Field Detail
-
identifier
protected String identifier
-
implClazz
protected final org.jboss.jandex.DotName implClazz
-
types
protected final Set<org.jboss.jandex.Type> types
-
qualifiers
protected final Set<org.jboss.jandex.AnnotationInstance> qualifiers
-
scope
protected ScopeInfo scope
-
alternative
protected Boolean alternative
-
stereotypes
protected final List<StereotypeInfo> stereotypes
-
name
protected String name
-
creatorConsumer
protected Consumer<io.quarkus.gizmo.MethodCreator> creatorConsumer
-
destroyerConsumer
protected Consumer<io.quarkus.gizmo.MethodCreator> destroyerConsumer
-
defaultBean
protected boolean defaultBean
-
removable
protected boolean removable
-
providerType
protected org.jboss.jandex.Type providerType
-
forceApplicationClass
protected boolean forceApplicationClass
-
targetPackageName
protected String targetPackageName
-
priority
protected Integer priority
-
injectionPoints
protected final Set<InjectionPointInfo.TypeAndQualifiers> injectionPoints
-
-
Method Detail
-
read
public THIS read(BeanConfiguratorBase<?,?> base)
Read metadata from another configurator base.- Parameters:
base-- Returns:
- self
-
types
public THIS types(org.jboss.jandex.Type... types)
-
addType
public THIS addType(org.jboss.jandex.DotName className)
-
addType
public THIS addType(org.jboss.jandex.Type type)
-
addQualifier
public THIS addQualifier(Class<? extends Annotation> annotationClass)
-
addQualifier
public THIS addQualifier(org.jboss.jandex.DotName annotationName)
-
addQualifier
public THIS addQualifier(org.jboss.jandex.AnnotationInstance qualifier)
-
addQualifier
public QualifierConfigurator<THIS> addQualifier()
-
qualifiers
public THIS qualifiers(org.jboss.jandex.AnnotationInstance... qualifiers)
-
scope
public THIS scope(Class<? extends Annotation> scope)
-
named
public THIS named(String name)
Unlike thename(String)method, a newNamedqualifier with the specified value is added to the configured bean.- Parameters:
name-- Returns:
- self
-
defaultBean
public THIS defaultBean()
-
unremovable
public THIS unremovable()
-
forceApplicationClass
public THIS forceApplicationClass()
Forces the bean to be considered an 'application class', so it will be defined in the runtime ClassLoader and re-created on each redeployment.- Returns:
- self
-
alternative
public THIS alternative(boolean alternative)
-
priority
public THIS priority(int value)
-
addStereotype
public THIS addStereotype(StereotypeInfo stereotype)
-
stereotypes
public THIS stereotypes(StereotypeInfo... stereotypes)
-
providerType
public THIS providerType(org.jboss.jandex.Type providerType)
The provider type is the "real" type of the bean instance created viaInjectableReferenceProvider.get(CreationalContext).The container attempts to derive the provider type from the implementation class. However, in some cases it's better to specify it manually.
- Parameters:
providerType-- Returns:
- self
-
addInjectionPoint
public THIS addInjectionPoint(org.jboss.jandex.Type requiredType, org.jboss.jandex.AnnotationInstance... requiredQualifiers)
Adds a synthetic injection point. The injection point is validated at build time and is also considered when removing unused beans.- Parameters:
requiredType-requiredQualifiers-- Returns:
- self
- See Also:
SyntheticCreationalContext
-
creator
public <U extends T> THIS creator(Class<? extends BeanCreator<U>> creatorClazz)
-
creator
public THIS creator(Consumer<io.quarkus.gizmo.MethodCreator> methodCreatorConsumer)
The first method parameter is the synthetic creational context, i.e. theMethodCreator#getMethodParam(0)returns aSyntheticCreationalContextinstance that can be used to obtain contextual references for synthetic injection points and build-time parameters.Furthermore, the consumer can also read the instance field of name
paramsand typeMap. This map holds all parameters set via one of theBeanConfigurator#param()methods.- Parameters:
methodCreatorConsumer-- Returns:
- self
-
destroyer
public <U extends T> THIS destroyer(Class<? extends BeanDestroyer<U>> destroyerClazz)
-
identifier
public THIS identifier(String identifier)
The identifier becomes part of theBeanInfo.getIdentifier()andInjectableBean.getIdentifier().An identifier can be used to register multiple synthetic beans with the same set of types and qualifiers.
- Parameters:
identifier-- Returns:
- self
- See Also:
defaultBean(),alternative(boolean)
-
cast
protected static <T> T cast(Object obj)
-
-