Class BeanConfiguratorBase<THIS extends BeanConfiguratorBase<THIS,​T>,​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 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
      • alternative

        protected Boolean alternative
      • 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
    • Constructor Detail

      • BeanConfiguratorBase

        protected BeanConfiguratorBase​(org.jboss.jandex.DotName implClazz)
    • Method Detail

      • read

        public THIS read​(BeanConfiguratorBase<?,​?> base)
        Read metadata from another configurator base.
        Parameters:
        base -
        Returns:
        self
      • types

        public THIS types​(Class<?>... types)
      • 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)
      • addType

        public THIS addType​(Class<?> type)
      • addQualifier

        public THIS addQualifier​(org.jboss.jandex.DotName annotationName)
      • addQualifier

        public THIS addQualifier​(org.jboss.jandex.AnnotationInstance qualifier)
      • qualifiers

        public THIS qualifiers​(org.jboss.jandex.AnnotationInstance... qualifiers)
      • named

        public THIS named​(String name)
        Unlike the name(String) method, a new Named qualifier 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
      • targetPackageName

        public THIS targetPackageName​(String name)
      • alternative

        public THIS alternative​(boolean alternative)
      • priority

        public THIS priority​(int value)
      • providerType

        public THIS providerType​(org.jboss.jandex.Type providerType)
        The provider type is the "real" type of the bean instance created via InjectableReferenceProvider.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 THIS creator​(Consumer<io.quarkus.gizmo.MethodCreator> methodCreatorConsumer)
        The first method parameter is the synthetic creational context, i.e. the MethodCreator#getMethodParam(0) returns a SyntheticCreationalContext instance 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 params and type Map. This map holds all parameters set via one of the BeanConfigurator#param() methods.

        Parameters:
        methodCreatorConsumer -
        Returns:
        self
      • destroyer

        public THIS destroyer​(Consumer<io.quarkus.gizmo.MethodCreator> methodCreatorConsumer)
      • cast

        protected static <T> T cast​(Object obj)