Class BeanProcessor.Builder
- Enclosing class:
BeanProcessor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAnnotationTransformation(org.jboss.jandex.AnnotationTransformation transformation) addAnnotationTransformer(AnnotationsTransformer transformer) Deprecated, for removal: This API element is subject to removal in a future version.addBeanRegistrar(BeanRegistrar registrar) addContextRegistrar(ContextRegistrar registrar) addExcludeType(Predicate<org.jboss.jandex.ClassInfo> predicate) Specify the types that should be excluded from discovery.addInjectionPointTransformer(InjectionPointsTransformer transformer) addInterceptorBindingRegistrar(InterceptorBindingRegistrar bindingRegistrar) addObserverRegistrar(ObserverRegistrar registrar) addObserverTransformer(ObserverTransformer transformer) addQualifierRegistrar(QualifierRegistrar qualifierRegistrar) addRemovalExclusion(Predicate<BeanInfo> predicate) Exclude unused beans that match the given predicate from removal.addResourceAnnotations(Collection<org.jboss.jandex.DotName> resourceAnnotations) addStereotypeRegistrar(StereotypeRegistrar stereotypeRegistrar) addSuppressConditionGenerator(Function<BeanInfo, Consumer<io.quarkus.gizmo.BytecodeCreator>> generator) A generator can contribute to the generatedInjectableBean.isSuppressed()method body.build()setAdditionalBeanDefiningAnnotations(Collection<BeanDefiningAnnotation> additionalBeanDefiningAnnotations) voidsetAllowMocking(boolean allowMocking) setAlternativePriorities(AlternativePriorities priorities) Can be used to compute a priority of an alternative bean.setApplicationClassPredicate(Predicate<org.jboss.jandex.DotName> applicationClassPredicate) setApplicationIndex(org.jboss.jandex.IndexView index) Set the application index.setBuildCompatibleExtensions(ExtensionsEntryPoint buildCompatibleExtensions) setComputingBeanArchiveIndex(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)setGenerateSources(boolean value) If set to true the will generate source files of all generated classes for debug purposes.setImmutableBeanArchiveIndex(org.jboss.jandex.IndexView index) Set the immutable bean archive index.setJtaCapabilities(boolean jtaCapabilities) setOptimizeContexts(boolean value) setOutput(ResourceOutput output) setReflectionRegistration(ReflectionRegistration reflectionRegistration) setRemoveUnusedBeans(boolean removeUnusedBeans) If set to true the container will attempt to remove all unused beans.setStrictCompatibility(boolean strictCompatibility) If set totrue, the container will perform additional validations mandated by the CDI specification.setTransformPrivateInjectedFields(boolean value) If set to true the container will transform injected private field of class based beans during validation.setTransformUnproxyableClasses(boolean value) If set to true the container will transform unproxyable bean classes during validation.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
setName
-
setComputingBeanArchiveIndex
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
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:
-
setApplicationIndex
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
-
addInterceptorBindingRegistrar
public BeanProcessor.Builder addInterceptorBindingRegistrar(InterceptorBindingRegistrar bindingRegistrar) -
addStereotypeRegistrar
-
setOutput
-
setReflectionRegistration
public BeanProcessor.Builder setReflectionRegistration(ReflectionRegistration reflectionRegistration) -
addAnnotationTransformer
@Deprecated(forRemoval=true) public BeanProcessor.Builder addAnnotationTransformer(AnnotationsTransformer transformer) Deprecated, for removal: This API element is subject to removal in a future version. -
addAnnotationTransformation
public BeanProcessor.Builder addAnnotationTransformation(org.jboss.jandex.AnnotationTransformation transformation) -
addInjectionPointTransformer
-
addObserverTransformer
-
addResourceAnnotations
public BeanProcessor.Builder addResourceAnnotations(Collection<org.jboss.jandex.DotName> resourceAnnotations) -
addBeanRegistrar
-
addObserverRegistrar
-
addContextRegistrar
-
addBeanDeploymentValidator
-
setApplicationClassPredicate
public BeanProcessor.Builder setApplicationClassPredicate(Predicate<org.jboss.jandex.DotName> applicationClassPredicate) -
setJtaCapabilities
-
setAllowMocking
public void setAllowMocking(boolean allowMocking) -
setRemoveUnusedBeans
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, - is not a result of resolving an invoker lookup
- Parameters:
removeUnusedBeans-- Returns:
- self
-
addRemovalExclusion
Exclude unused beans that match the given predicate from removal.- Parameters:
predicate-- Returns:
- self
- See Also:
-
setTransformUnproxyableClasses
If set to true the container will transform unproxyable bean classes during validation.- Parameters:
value-- Returns:
- self
-
setTransformPrivateInjectedFields
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
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
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. -
setOptimizeContexts
- Parameters:
value-- Returns:
- self
-
setOptimizeContexts
- Parameters:
fun-- Returns:
- self
-
setAlternativePriorities
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
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
-
addAnnotationTransformation(AnnotationTransformation)