Class BeanProcessor.Builder
- java.lang.Object
-
- io.quarkus.arc.processor.BeanProcessor.Builder
-
- Enclosing class:
- BeanProcessor
public static class BeanProcessor.Builder extends Object
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BeanProcessor.BuilderaddAnnotationTransformer(AnnotationsTransformer transformer)BeanProcessor.BuilderaddBeanDeploymentValidator(BeanDeploymentValidator validator)BeanProcessor.BuilderaddBeanRegistrar(BeanRegistrar registrar)BeanProcessor.BuilderaddContextRegistrar(ContextRegistrar registrar)BeanProcessor.BuilderaddExcludeType(Predicate<org.jboss.jandex.ClassInfo> predicate)Specify the types that should be excluded from discovery.BeanProcessor.BuilderaddInjectionPointTransformer(InjectionPointsTransformer transformer)BeanProcessor.BuilderaddInterceptorBindingRegistrar(InterceptorBindingRegistrar bindingRegistrar)BeanProcessor.BuilderaddObserverRegistrar(ObserverRegistrar registrar)BeanProcessor.BuilderaddObserverTransformer(ObserverTransformer transformer)BeanProcessor.BuilderaddQualifierRegistrar(QualifierRegistrar qualifierRegistrar)BeanProcessor.BuilderaddRemovalExclusion(Predicate<BeanInfo> predicate)Exclude unused beans that match the given predicate from removal.BeanProcessor.BuilderaddResourceAnnotations(Collection<org.jboss.jandex.DotName> resourceAnnotations)BeanProcessor.BuilderaddStereotypeRegistrar(StereotypeRegistrar stereotypeRegistrar)BeanProcessor.BuilderaddSuppressConditionGenerator(Function<BeanInfo,Consumer<io.quarkus.gizmo.BytecodeCreator>> generator)A generator can contribute to the generatedInjectableBean.isSuppressed()method body.BeanProcessorbuild()BeanProcessor.BuildersetAdditionalBeanDefiningAnnotations(Collection<BeanDefiningAnnotation> additionalBeanDefiningAnnotations)voidsetAllowMocking(boolean allowMocking)BeanProcessor.BuildersetAlternativePriorities(AlternativePriorities priorities)Can be used to compute a priority of an alternative bean.BeanProcessor.BuildersetApplicationClassPredicate(Predicate<org.jboss.jandex.DotName> applicationClassPredicate)BeanProcessor.BuildersetApplicationIndex(org.jboss.jandex.IndexView index)Set the application index.BeanProcessor.BuildersetBuildCompatibleExtensions(ExtensionsEntryPoint buildCompatibleExtensions)BeanProcessor.BuildersetComputingBeanArchiveIndex(org.jboss.jandex.IndexView index)Set the computing bean archive index.voidsetFailOnInterceptedPrivateMethod(boolean failOnInterceptedPrivateMethod)If set to true, the build will fail if an annotation that would result in an interceptor being created (such as@Transactional)BeanProcessor.BuildersetGenerateSources(boolean value)If set to true the will generate source files of all generated classes for debug purposes.BeanProcessor.BuildersetImmutableBeanArchiveIndex(org.jboss.jandex.IndexView index)Set the immutable bean archive index.BeanProcessor.BuildersetJtaCapabilities(boolean jtaCapabilities)BeanProcessor.BuildersetName(String name)BeanProcessor.BuildersetOutput(ResourceOutput output)BeanProcessor.BuildersetReflectionRegistration(ReflectionRegistration reflectionRegistration)BeanProcessor.BuildersetRemoveUnusedBeans(boolean removeUnusedBeans)If set to true the container will attempt to remove all unused beans.BeanProcessor.BuildersetStrictCompatibility(boolean strictCompatibility)If set totrue, the container will perform additional validations mandated by the CDI specification.BeanProcessor.BuildersetTransformPrivateInjectedFields(boolean value)If set to true the container will transform injected private field of class based beans during validation.BeanProcessor.BuildersetTransformUnproxyableClasses(boolean value)If set to true the container will transform unproxyable bean classes during validation.
-
-
-
Method Detail
-
setName
public BeanProcessor.Builder setName(String name)
-
setComputingBeanArchiveIndex
public BeanProcessor.Builder setComputingBeanArchiveIndex(org.jboss.jandex.IndexView index)
Set the computing bean archive index. This index is optional and can be used for example during type-safe resolution. If it's not set then the immutable index is used instead.The computing index must be built on top of the immutable index and compute only the classes that are not part of the immutable index.
This index is never used to discover components (beans, observers, etc.).
- Parameters:
index-- Returns:
- self
- See Also:
setImmutableBeanArchiveIndex(IndexView)
-
setImmutableBeanArchiveIndex
public BeanProcessor.Builder setImmutableBeanArchiveIndex(org.jboss.jandex.IndexView index)
Set the immutable bean archive index. This index is mandatory and is used to discover components (beans, observers, etc.).- Parameters:
index-- Returns:
- self
- See Also:
setComputingBeanArchiveIndex(IndexView)
-
setApplicationIndex
public BeanProcessor.Builder setApplicationIndex(org.jboss.jandex.IndexView index)
Set the application index. This index is optional and is also used to discover types during type-safe resolution.Some types may not be part of the bean archive index but are still needed during type-safe resolution.
- Parameters:
index-- Returns:
- self
-
setAdditionalBeanDefiningAnnotations
public BeanProcessor.Builder setAdditionalBeanDefiningAnnotations(Collection<BeanDefiningAnnotation> additionalBeanDefiningAnnotations)
-
addQualifierRegistrar
public BeanProcessor.Builder addQualifierRegistrar(QualifierRegistrar qualifierRegistrar)
-
addInterceptorBindingRegistrar
public BeanProcessor.Builder addInterceptorBindingRegistrar(InterceptorBindingRegistrar bindingRegistrar)
-
addStereotypeRegistrar
public BeanProcessor.Builder addStereotypeRegistrar(StereotypeRegistrar stereotypeRegistrar)
-
setOutput
public BeanProcessor.Builder setOutput(ResourceOutput output)
-
setReflectionRegistration
public BeanProcessor.Builder setReflectionRegistration(ReflectionRegistration reflectionRegistration)
-
addAnnotationTransformer
public BeanProcessor.Builder addAnnotationTransformer(AnnotationsTransformer transformer)
-
addInjectionPointTransformer
public BeanProcessor.Builder addInjectionPointTransformer(InjectionPointsTransformer transformer)
-
addObserverTransformer
public BeanProcessor.Builder addObserverTransformer(ObserverTransformer transformer)
-
addResourceAnnotations
public BeanProcessor.Builder addResourceAnnotations(Collection<org.jboss.jandex.DotName> resourceAnnotations)
-
addBeanRegistrar
public BeanProcessor.Builder addBeanRegistrar(BeanRegistrar registrar)
-
addObserverRegistrar
public BeanProcessor.Builder addObserverRegistrar(ObserverRegistrar registrar)
-
addContextRegistrar
public BeanProcessor.Builder addContextRegistrar(ContextRegistrar registrar)
-
addBeanDeploymentValidator
public BeanProcessor.Builder addBeanDeploymentValidator(BeanDeploymentValidator validator)
-
setApplicationClassPredicate
public BeanProcessor.Builder setApplicationClassPredicate(Predicate<org.jboss.jandex.DotName> applicationClassPredicate)
-
setJtaCapabilities
public BeanProcessor.Builder setJtaCapabilities(boolean jtaCapabilities)
-
setAllowMocking
public void setAllowMocking(boolean allowMocking)
-
setRemoveUnusedBeans
public BeanProcessor.Builder setRemoveUnusedBeans(boolean removeUnusedBeans)
If set to true the container will attempt to remove all unused beans.An unused bean:
- is not a built-in bean or interceptor,
- is not eligible for injection to any injection point,
- is not excluded - see
addRemovalExclusion(Predicate), - does not have a name,
- does not declare an observer,
- does not declare any producer which is eligible for injection to any injection point,
- is not directly eligible for injection into any
Instanceinjection point
- Parameters:
removeUnusedBeans-- Returns:
- self
-
addRemovalExclusion
public BeanProcessor.Builder addRemovalExclusion(Predicate<BeanInfo> predicate)
Exclude unused beans that match the given predicate from removal.- Parameters:
predicate-- Returns:
- self
- See Also:
setRemoveUnusedBeans(boolean)
-
setTransformUnproxyableClasses
public BeanProcessor.Builder setTransformUnproxyableClasses(boolean value)
If set to true the container will transform unproxyable bean classes during validation.- Parameters:
value-- Returns:
- self
-
setTransformPrivateInjectedFields
public BeanProcessor.Builder setTransformPrivateInjectedFields(boolean value)
If set to true the container will transform injected private field of class based beans during validation.- Parameters:
value-- Returns:
- self
-
setFailOnInterceptedPrivateMethod
public void setFailOnInterceptedPrivateMethod(boolean failOnInterceptedPrivateMethod)
If set to true, the build will fail if an annotation that would result in an interceptor being created (such as@Transactional)
-
setGenerateSources
public BeanProcessor.Builder setGenerateSources(boolean value)
If set to true the will generate source files of all generated classes for debug purposes. The generated source is not actually a source file but a textual representation of generated code.- Parameters:
value-- Returns:
- self
-
setStrictCompatibility
public BeanProcessor.Builder setStrictCompatibility(boolean strictCompatibility)
If set totrue, the container will perform additional validations mandated by the CDI specification. Some improvements on top of the CDI specification may be disabled. Applications that work as expected in the strict mode should work without a change in the default, non-strict mode.The strict mode is mainly introduced to allow passing the CDI Lite TCK. Applications are recommended to use the default, non-strict mode, which makes CDI more convenient to use. The "strictness" of the strict mode (the set of additional validations and the set of disabled improvements on top of the CDI specification) may change over time.
Note that
setTransformUnproxyableClasses(boolean)also has effect on specification compatibility. Set it tofalsewhen unproxyable bean types should always lead to a deployment problem.
-
setAlternativePriorities
public BeanProcessor.Builder setAlternativePriorities(AlternativePriorities priorities)
Can be used to compute a priority of an alternative bean. A non-null computed value always takes precedence over the priority defined byPriorityor a stereotype.- Parameters:
priorities-- Returns:
- self
-
addExcludeType
public BeanProcessor.Builder addExcludeType(Predicate<org.jboss.jandex.ClassInfo> predicate)
Specify the types that should be excluded from discovery.- Parameters:
predicate-- Returns:
- self
-
addSuppressConditionGenerator
public BeanProcessor.Builder addSuppressConditionGenerator(Function<BeanInfo,Consumer<io.quarkus.gizmo.BytecodeCreator>> generator)
A generator can contribute to the generatedInjectableBean.isSuppressed()method body.- Parameters:
generator-- Returns:
- self
-
setBuildCompatibleExtensions
public BeanProcessor.Builder setBuildCompatibleExtensions(ExtensionsEntryPoint buildCompatibleExtensions)
-
build
public BeanProcessor build()
-
-