Class AbstractInitializableBeanDefinition<T>

  • Type Parameters:
    T - The Bean definition type
    All Implemented Interfaces:
    EnvironmentConfigurable, io.micronaut.core.annotation.AnnotationMetadata, io.micronaut.core.annotation.AnnotationMetadataDelegate, io.micronaut.core.annotation.AnnotationMetadataProvider, io.micronaut.core.annotation.AnnotationSource, io.micronaut.core.naming.Named, io.micronaut.core.type.ArgumentCoercible<T>, BeanContextConditional, BeanDefinition<T>, BeanType<T>

    @Internal
    public class AbstractInitializableBeanDefinition<T>
    extends java.lang.Object
    implements BeanDefinition<T>, EnvironmentConfigurable

    Default implementation of the BeanDefinition interface. This class is generally not used directly in user code. Instead a build time tool does analysis of source code and dynamically produces subclasses of this class containing information about the available injection points for a given class.

    For technical reasons the class has to be marked as public, but is regarded as internal and should be used by compiler tools and plugins (such as AST transformation frameworks)

    The BeanDefinitionWriter class can be used to produce bean definitions at compile or runtime

    Since:
    3.0
    See Also:
    BeanDefinitionWriter
    • Method Detail

      • isContainerType

        public final boolean isContainerType()
        Description copied from interface: BeanType
        Checks whether the bean type is a container type.
        Specified by:
        isContainerType in interface BeanType<T>
        Returns:
        Whether the type is a container type like Iterable.
      • hasPropertyExpressions

        public final boolean hasPropertyExpressions()
        Specified by:
        hasPropertyExpressions in interface io.micronaut.core.annotation.AnnotationMetadata
        Specified by:
        hasPropertyExpressions in interface io.micronaut.core.annotation.AnnotationMetadataDelegate
        Specified by:
        hasPropertyExpressions in interface EnvironmentConfigurable
        Returns:
        Whether any environment specific property expressions exist in the object.
      • getTypeArguments

        @NonNull
        public final java.util.List<io.micronaut.core.type.Argument<?>> getTypeArguments​(java.lang.String type)
        Description copied from interface: BeanDefinition
        Return the type arguments for the given interface or super type for this bean.
        Specified by:
        getTypeArguments in interface BeanDefinition<T>
        Parameters:
        type - The super class or interface type
        Returns:
        The type arguments
      • getAnnotationMetadata

        @NonNull
        public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
        Specified by:
        getAnnotationMetadata in interface io.micronaut.core.annotation.AnnotationMetadataProvider
      • isAbstract

        public boolean isAbstract()
        Specified by:
        isAbstract in interface BeanDefinition<T>
        Returns:
        Whether the bean definition is abstract
      • isPrimary

        public boolean isPrimary()
        Specified by:
        isPrimary in interface BeanType<T>
        Returns:
        Whether the bean definition is the Primary
      • isProvided

        public boolean isProvided()
        Specified by:
        isProvided in interface BeanDefinition<T>
        Returns:
        Is this definition provided by another bean
        See Also:
        Provided
      • findMethod

        public final <R> java.util.Optional<ExecutableMethod<T,​R>> findMethod​(java.lang.String name,
                                                                                    java.lang.Class<?>... argumentTypes)
        Description copied from interface: BeanDefinition
        Finds a single ExecutableMethod for the given name and argument types.
        Specified by:
        findMethod in interface BeanDefinition<T>
        Type Parameters:
        R - The return type
        Parameters:
        name - The method name
        argumentTypes - The argument types
        Returns:
        An optional ExecutableMethod
      • findPossibleMethods

        public final <R> java.util.stream.Stream<ExecutableMethod<T,​R>> findPossibleMethods​(java.lang.String name)
        Description copied from interface: BeanDefinition
        Finds possible methods for the given method name.
        Specified by:
        findPossibleMethods in interface BeanDefinition<T>
        Type Parameters:
        R - The return type
        Parameters:
        name - The method name
        Returns:
        The possible methods
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • isSingleton

        public boolean isSingleton()
        Specified by:
        isSingleton in interface BeanDefinition<T>
        Returns:
        Whether the scope is singleton
      • getScope

        public final java.util.Optional<java.lang.Class<? extends java.lang.annotation.Annotation>> getScope()
        Specified by:
        getScope in interface BeanDefinition<T>
        Returns:
        The scope of the bean
      • getScopeName

        public final java.util.Optional<java.lang.String> getScopeName()
        Specified by:
        getScopeName in interface BeanDefinition<T>
        Returns:
        The name of the scope
      • getExposedTypes

        @NonNull
        public java.util.Set<java.lang.Class<?>> getExposedTypes()
        Description copied from interface: BeanType
        Returns a potentially limited subset of bean types exposed by this bean. The types to be exposed can be defined by the Type annotation.
        Specified by:
        getExposedTypes in interface BeanType<T>
        Returns:
        The exposed types
      • getDeclaringType

        public final java.util.Optional<java.lang.Class<?>> getDeclaringType()
        Specified by:
        getDeclaringType in interface BeanDefinition<T>
        Returns:
        The type that declares this definition, null if not applicable.
      • getRequiredComponents

        public final java.util.Collection<java.lang.Class<?>> getRequiredComponents()
        Specified by:
        getRequiredComponents in interface BeanDefinition<T>
        Returns:
        All required components for this entity definition
      • getPostConstructMethods

        public final java.util.List<MethodInjectionPoint<T,​?>> getPostConstructMethods()
        Description copied from interface: BeanDefinition
        All the methods that should be called once the bean has been fully initialized and constructed.
        Specified by:
        getPostConstructMethods in interface BeanDefinition<T>
        Returns:
        Methods to call post construct
      • getName

        @NonNull
        public final java.lang.String getName()
        Specified by:
        getName in interface BeanDefinition<T>
        Specified by:
        getName in interface BeanType<T>
        Specified by:
        getName in interface io.micronaut.core.naming.Named
        Returns:
        The class name
      • inject

        public T inject​(BeanContext context,
                        T bean)
        Description copied from interface: BeanDefinition
        Inject the given bean with the context.
        Specified by:
        inject in interface BeanDefinition<T>
        Parameters:
        context - The context
        bean - The bean
        Returns:
        The injected bean
      • inject

        public T inject​(BeanResolutionContext resolutionContext,
                        BeanContext context,
                        T bean)
        Description copied from interface: BeanDefinition
        Inject the given bean with the context.
        Specified by:
        inject in interface BeanDefinition<T>
        Parameters:
        resolutionContext - the resolution context
        context - The context
        bean - The bean
        Returns:
        The injected bean
      • configure

        @Internal
        public final void configure​(Environment environment)
        Configures the bean for the given BeanContext. If the context features an Environment this method configures the annotation metadata such that environment aware values are returned.
        Specified by:
        configure in interface EnvironmentConfigurable
        Parameters:
        environment - The environment
      • warn

        @Internal
        protected final void warn​(java.lang.String message)
        Allows printing warning messages produced by the compiler.
        Parameters:
        message - The message
      • warnMissingProperty

        @Internal
        protected final void warnMissingProperty​(java.lang.Class type,
                                                 java.lang.String method,
                                                 java.lang.String property)
        Allows printing warning messages produced by the compiler.
        Parameters:
        type - The type
        method - The method
        property - The property
      • getProxiedBean

        @Internal
        protected final java.lang.Object getProxiedBean​(BeanContext beanContext)
        Resolves the proxied bean instance for this bean.
        Parameters:
        beanContext - The BeanContext
        Returns:
        The proxied bean
      • getRequiredArguments

        public final io.micronaut.core.type.Argument<?>[] getRequiredArguments()
        Returns:
        The arguments required to construct parametrized bean
      • doBuild

        @Internal
        protected T doBuild​(BeanResolutionContext resolutionContext,
                            BeanContext context,
                            BeanDefinition<T> definition,
                            java.util.Map<java.lang.String,​java.lang.Object> requiredArgumentValues)
        Method to be implemented by the generated code if the bean definition is implementing ParametrizedBeanFactory.
        Parameters:
        resolutionContext - The resolution context
        context - The bean context
        definition - The bean definition
        requiredArgumentValues - The required arguments
        Returns:
        The built instance
      • injectBean

        @Internal
        protected java.lang.Object injectBean​(BeanResolutionContext resolutionContext,
                                              BeanContext context,
                                              java.lang.Object bean)
        The default implementation which provides no injection. To be overridden by compile time tooling.
        Parameters:
        resolutionContext - The resolution context
        context - The bean context
        bean - The bean
        Returns:
        The injected bean
      • injectAnother

        @Internal
        protected java.lang.Object injectAnother​(BeanResolutionContext resolutionContext,
                                                 BeanContext context,
                                                 java.lang.Object bean)
        Inject another bean, for example one created via factory.
        Parameters:
        resolutionContext - The reslution context
        context - The context
        bean - The bean
        Returns:
        The bean
      • postConstruct

        @Internal
        protected java.lang.Object postConstruct​(BeanResolutionContext resolutionContext,
                                                 BeanContext context,
                                                 java.lang.Object bean)
        Default postConstruct hook that only invokes methods that require reflection. Generated subclasses should override to call methods that don't require reflection.
        Parameters:
        resolutionContext - The resolution hook
        context - The context
        bean - The bean
        Returns:
        The bean
      • preDestroy

        @Internal
        protected java.lang.Object preDestroy​(BeanResolutionContext resolutionContext,
                                              BeanContext context,
                                              java.lang.Object bean)
        Default preDestroy hook that only invokes methods that require reflection. Generated subclasses should override to call methods that don't require reflection.
        Parameters:
        resolutionContext - The resolution hook
        context - The context
        bean - The bean
        Returns:
        The bean
      • isInnerConfiguration

        @Internal
        protected boolean isInnerConfiguration​(java.lang.Class<?> clazz)
        Check if the class is an inner configuration.
        Parameters:
        clazz - The class to check
        Returns:
        true if the inner configuration
      • checkIfShouldLoad

        @Internal
        protected void checkIfShouldLoad​(BeanResolutionContext resolutionContext,
                                         BeanContext context)
        Checks whether the bean should be loaded.
        Parameters:
        resolutionContext - - the resolution context
        context - - the bean context
      • checkInjectedBeanPropertyValue

        @Internal
        protected final void checkInjectedBeanPropertyValue​(java.lang.String injectedBeanPropertyName,
                                                            @Nullable
                                                            java.lang.Object beanPropertyValue,
                                                            @Nullable
                                                            java.lang.String requiredValue,
                                                            @Nullable
                                                            java.lang.String notEqualsValue)
        Check the value of the injected bean property to decide whether the bean should be loaded.
        Parameters:
        injectedBeanPropertyName - the name of the injected bean property
        beanPropertyValue - the value of injected bean property
        requiredValue - the value which is required for the bean to be loaded
        notEqualsValue - the value which bean property should not be equal to for the bean to be loaded
      • invokeMethodWithReflection

        @Internal
        protected final void invokeMethodWithReflection​(BeanResolutionContext resolutionContext,
                                                        BeanContext context,
                                                        int methodIndex,
                                                        java.lang.Object bean,
                                                        java.lang.Object[] methodArgs)
        Invoke a bean method that requires reflection.
        Parameters:
        resolutionContext - The resolution context
        context - The bean context
        methodIndex - The method index
        bean - The bean
        methodArgs - The method args
      • setFieldWithReflection

        @Internal
        protected final void setFieldWithReflection​(BeanResolutionContext resolutionContext,
                                                    BeanContext context,
                                                    int index,
                                                    java.lang.Object object,
                                                    java.lang.Object value)
        Sets the value of a field of a object that requires reflection.
        Parameters:
        resolutionContext - The resolution context
        context - The object context
        index - The index of the field
        object - The object whose field should be modifie
        value - The instance being set
      • getValueForMethodArgument

        @Internal
        @Deprecated
        protected final java.lang.Object getValueForMethodArgument​(BeanResolutionContext resolutionContext,
                                                                   BeanContext context,
                                                                   int methodIndex,
                                                                   int argIndex,
                                                                   Qualifier qualifier)
        Deprecated.
        Obtains a value for the given method argument.
        Parameters:
        resolutionContext - The resolution context
        context - The bean context
        methodIndex - The method index
        argIndex - The argument index
        qualifier - The qualifier
        Returns:
        The value
      • getPropertyValueForMethodArgument

        @Internal
        protected final java.lang.Object getPropertyValueForMethodArgument​(BeanResolutionContext resolutionContext,
                                                                           BeanContext context,
                                                                           int methodIndex,
                                                                           int argIndex,
                                                                           java.lang.String propertyValue,
                                                                           java.lang.String cliProperty)
        Obtains a property value for the given method argument.
        Parameters:
        resolutionContext - The resolution context
        context - The bean context
        methodIndex - The method index
        argIndex - The argument index
        propertyValue - The property value
        cliProperty - The cli property
        Returns:
        The value
      • getPropertyPlaceholderValueForMethodArgument

        @Internal
        protected final java.lang.Object getPropertyPlaceholderValueForMethodArgument​(BeanResolutionContext resolutionContext,
                                                                                      BeanContext context,
                                                                                      int methodIndex,
                                                                                      int argIndex,
                                                                                      java.lang.String value)
        Obtains a placeholder value for the given method argument.
        Parameters:
        resolutionContext - The resolution context
        context - The bean context
        methodIndex - The method index
        argIndex - The argument index
        value - The property value
        Returns:
        The value
      • getPropertyValueForSetter

        @Internal
        protected final java.lang.Object getPropertyValueForSetter​(BeanResolutionContext resolutionContext,
                                                                   BeanContext context,
                                                                   java.lang.String setterName,
                                                                   io.micronaut.core.type.Argument<?> argument,
                                                                   java.lang.String propertyValue,
                                                                   java.lang.String cliProperty)
        Obtains a property value for the given method argument.
        Parameters:
        resolutionContext - The resolution context
        context - The bean context
        setterName - The setter name
        argument - The argument
        propertyValue - The property value
        cliProperty - The cli property
        Returns:
        The value
      • getPropertyPlaceholderValueForSetter

        @Internal
        protected final java.lang.Object getPropertyPlaceholderValueForSetter​(BeanResolutionContext resolutionContext,
                                                                              BeanContext context,
                                                                              java.lang.String setterName,
                                                                              io.micronaut.core.type.Argument<?> argument,
                                                                              java.lang.String value)
        Obtains a placeholder value for the given method argument.
        Parameters:
        resolutionContext - The resolution context
        context - The bean context
        setterName - The setter name
        argument - The argument
        value - The value
        Returns:
        The value
      • containsValueForMethodArgument

        @Internal
        @Deprecated
        protected final boolean containsValueForMethodArgument​(BeanResolutionContext resolutionContext,
                                                               BeanContext context,
                                                               int methodIndex,
                                                               int argIndex,
                                                               boolean isValuePrefix)
        Deprecated.
        Obtains a value for the given method argument.
        Parameters:
        resolutionContext - The resolution context
        context - The bean context
        methodIndex - The method index
        argIndex - The argument index
        isValuePrefix - Is value prefix in cases when beans are requested
        Returns:
        The value
      • getBeanForMethodArgument

        @Internal
        protected final <K> K getBeanForMethodArgument​(BeanResolutionContext resolutionContext,
                                                       BeanContext context,
                                                       int methodIndex,
                                                       int argIndex,
                                                       Qualifier<K> qualifier)
        Obtains a bean definition for the method at the given index and the argument at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        methodIndex - The method index
        argIndex - The argument index
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getBeansOfTypeForMethodArgument

        @Internal
        protected final <K,​R extends java.util.Collection<K>> R getBeansOfTypeForMethodArgument​(BeanResolutionContext resolutionContext,
                                                                                                      BeanContext context,
                                                                                                      int methodIndex,
                                                                                                      int argumentIndex,
                                                                                                      io.micronaut.core.type.Argument<K> genericType,
                                                                                                      Qualifier<K> qualifier)
        Obtains all bean definitions for a method argument at the given index.
        Type Parameters:
        K - The bean type
        R - The result collection type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        methodIndex - The method index
        argumentIndex - The argument index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getBeanForSetter

        @Internal
        protected final java.lang.Object getBeanForSetter​(BeanResolutionContext resolutionContext,
                                                          BeanContext context,
                                                          java.lang.String setterName,
                                                          io.micronaut.core.type.Argument argument,
                                                          Qualifier qualifier)
        Obtains a bean definition for the method at the given index and the argument at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Parameters:
        resolutionContext - The resolution context
        context - The context
        setterName - The setter name
        argument - The argument
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getBeansOfTypeForSetter

        @Internal
        protected final java.util.Collection<java.lang.Object> getBeansOfTypeForSetter​(BeanResolutionContext resolutionContext,
                                                                                       BeanContext context,
                                                                                       java.lang.String setterName,
                                                                                       io.micronaut.core.type.Argument argument,
                                                                                       io.micronaut.core.type.Argument genericType,
                                                                                       Qualifier qualifier)
        Obtains all bean definitions for a method argument at the given index.
        Parameters:
        resolutionContext - The resolution context
        context - The context
        setterName - The setter name
        argument - The argument
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • findBeanForMethodArgument

        @Internal
        protected final <K> java.util.Optional<K> findBeanForMethodArgument​(BeanResolutionContext resolutionContext,
                                                                            BeanContext context,
                                                                            int methodIndex,
                                                                            int argIndex,
                                                                            io.micronaut.core.type.Argument<K> genericType,
                                                                            Qualifier<K> qualifier)
        Obtains an optional bean for the method at the given index and the argument at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        methodIndex - The method index
        argIndex - The argument index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getStreamOfTypeForMethodArgument

        @Internal
        protected final java.util.stream.Stream<?> getStreamOfTypeForMethodArgument​(BeanResolutionContext resolutionContext,
                                                                                    BeanContext context,
                                                                                    int methodIndex,
                                                                                    int argIndex,
                                                                                    io.micronaut.core.type.Argument genericType,
                                                                                    Qualifier qualifier)
        Obtains all bean definitions for the method at the given index and the argument at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Parameters:
        resolutionContext - The resolution context
        context - The context
        methodIndex - The method index
        argIndex - The argument index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getBeanForConstructorArgument

        @Internal
        protected final java.lang.Object getBeanForConstructorArgument​(BeanResolutionContext resolutionContext,
                                                                       BeanContext context,
                                                                       int argIndex,
                                                                       Qualifier qualifier)
        Obtains a bean definition for a constructor at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Parameters:
        resolutionContext - The resolution context
        context - The context
        argIndex - The argument index
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getValueForConstructorArgument

        @Internal
        @Deprecated
        protected final java.lang.Object getValueForConstructorArgument​(BeanResolutionContext resolutionContext,
                                                                        BeanContext context,
                                                                        int argIndex,
                                                                        Qualifier qualifier)
        Deprecated.
        Obtains a value for a bean definition for a constructor at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Parameters:
        resolutionContext - The resolution context
        context - The context
        argIndex - The argument index
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getPropertyValueForConstructorArgument

        @Internal
        protected final java.lang.Object getPropertyValueForConstructorArgument​(BeanResolutionContext resolutionContext,
                                                                                BeanContext context,
                                                                                int argIndex,
                                                                                java.lang.String propertyValue,
                                                                                java.lang.String cliProperty)
        Obtains a property value for a bean definition for a constructor at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Parameters:
        resolutionContext - The resolution context
        context - The context
        argIndex - The argument index
        propertyValue - The property value
        cliProperty - The cli property
        Returns:
        The resolved bean
      • getPropertyPlaceholderValueForConstructorArgument

        @Internal
        protected final java.lang.Object getPropertyPlaceholderValueForConstructorArgument​(BeanResolutionContext resolutionContext,
                                                                                           BeanContext context,
                                                                                           int argIndex,
                                                                                           java.lang.String propertyValue)
        Obtains a property value for a bean definition for a constructor at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Parameters:
        resolutionContext - The resolution context
        context - The context
        argIndex - The argument index
        propertyValue - The property value
        Returns:
        The resolved bean
      • getBeansOfTypeForConstructorArgument

        @Internal
        protected final java.util.Collection<java.lang.Object> getBeansOfTypeForConstructorArgument​(BeanResolutionContext resolutionContext,
                                                                                                    BeanContext context,
                                                                                                    int argumentIndex,
                                                                                                    io.micronaut.core.type.Argument genericType,
                                                                                                    Qualifier qualifier)
        Obtains all bean definitions for a constructor argument at the given index.
        Parameters:
        resolutionContext - The resolution context
        context - The context
        argumentIndex - The argument index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getBeanRegistrationsForConstructorArgument

        @Internal
        protected final <K,​R extends java.util.Collection<BeanRegistration<K>>> R getBeanRegistrationsForConstructorArgument​(BeanResolutionContext resolutionContext,
                                                                                                                                   BeanContext context,
                                                                                                                                   int argumentIndex,
                                                                                                                                   io.micronaut.core.type.Argument<K> genericType,
                                                                                                                                   Qualifier<K> qualifier)
        Obtains all bean definitions for a constructor argument at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        R - The result collection type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        argumentIndex - The argument index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getBeanRegistrationForConstructorArgument

        @Internal
        protected final <K> BeanRegistration<K> getBeanRegistrationForConstructorArgument​(BeanResolutionContext resolutionContext,
                                                                                          BeanContext context,
                                                                                          int argumentIndex,
                                                                                          io.micronaut.core.type.Argument<K> genericType,
                                                                                          Qualifier<K> qualifier)
        Obtains a bean registration for a method injection point.

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        argumentIndex - The arg index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean registration
      • getBeanRegistrationsForMethodArgument

        @Internal
        protected final <K,​R extends java.util.Collection<BeanRegistration<K>>> R getBeanRegistrationsForMethodArgument​(BeanResolutionContext resolutionContext,
                                                                                                                              BeanContext context,
                                                                                                                              int methodIndex,
                                                                                                                              int argIndex,
                                                                                                                              io.micronaut.core.type.Argument<K> genericType,
                                                                                                                              Qualifier<K> qualifier)
        Obtains all bean definitions for a method injection point.

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        R - The result collection type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        methodIndex - The method index
        argIndex - The arg index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getBeanRegistrationForMethodArgument

        @Internal
        protected final <K> BeanRegistration<K> getBeanRegistrationForMethodArgument​(BeanResolutionContext resolutionContext,
                                                                                     BeanContext context,
                                                                                     int methodIndex,
                                                                                     int argIndex,
                                                                                     io.micronaut.core.type.Argument<K> genericType,
                                                                                     Qualifier<K> qualifier)
        Obtains a bean registration for a method injection point.

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        methodIndex - The method index
        argIndex - The arg index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean registration
      • getStreamOfTypeForConstructorArgument

        @Internal
        protected final <K> java.util.stream.Stream<K> getStreamOfTypeForConstructorArgument​(BeanResolutionContext resolutionContext,
                                                                                             BeanContext context,
                                                                                             int argIndex,
                                                                                             io.micronaut.core.type.Argument<K> genericType,
                                                                                             Qualifier<K> qualifier)
        Obtains all bean definitions for a constructor argument at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        argIndex - The argument index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • findBeanForConstructorArgument

        @Internal
        protected final <K> java.util.Optional<K> findBeanForConstructorArgument​(BeanResolutionContext resolutionContext,
                                                                                 BeanContext context,
                                                                                 int argIndex,
                                                                                 io.micronaut.core.type.Argument<K> genericType,
                                                                                 Qualifier<K> qualifier)
        Obtains all bean definitions for a constructor argument at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        argIndex - The argument index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getBeanForField

        @Internal
        protected final <K> K getBeanForField​(BeanResolutionContext resolutionContext,
                                              BeanContext context,
                                              int fieldIndex,
                                              Qualifier<K> qualifier)
        Obtains a bean definition for the field at the given index and the argument at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        fieldIndex - The field index
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getValueForField

        @Internal
        @Deprecated
        protected final java.lang.Object getValueForField​(BeanResolutionContext resolutionContext,
                                                          BeanContext context,
                                                          int fieldIndex,
                                                          Qualifier qualifier)
        Deprecated.
        Obtains a value for the given field from the bean context

        Warning: this method is used by internal generated code and should not be called by user code.

        Parameters:
        resolutionContext - The resolution context
        context - The context
        fieldIndex - The index of the field
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getPropertyValueForField

        @Internal
        @Deprecated
        protected final java.lang.Object getPropertyValueForField​(BeanResolutionContext resolutionContext,
                                                                  BeanContext context,
                                                                  io.micronaut.core.type.Argument argument,
                                                                  java.lang.String propertyValue,
                                                                  java.lang.String cliProperty)
        Deprecated.
        Obtains a property value for the given field from the bean context

        Warning: this method is used by internal generated code and should not be called by user code.

        Parameters:
        resolutionContext - The resolution context
        context - The context
        argument - The argument
        propertyValue - The property value
        cliProperty - The clie property name
        Returns:
        The resolved bean
      • getPropertyPlaceholderValueForField

        @Internal
        @Deprecated
        protected final java.lang.Object getPropertyPlaceholderValueForField​(BeanResolutionContext resolutionContext,
                                                                             BeanContext context,
                                                                             io.micronaut.core.type.Argument argument,
                                                                             java.lang.String placeholder)
        Deprecated.
        Obtains a property placeholder value for the given field from the bean context

        Warning: this method is used by internal generated code and should not be called by user code.

        Parameters:
        resolutionContext - The resolution context
        context - The context
        argument - The argument
        placeholder - The placeholder
        Returns:
        The resolved bean
      • getValueForPath

        @Internal
        protected final <T1> java.util.Optional<T1> getValueForPath​(BeanResolutionContext resolutionContext,
                                                                    BeanContext context,
                                                                    io.micronaut.core.type.Argument<T1> propertyType,
                                                                    java.lang.String propertyPath)
        Resolve a value for the given field of the given type and path.
        Type Parameters:
        T1 - The generic type
        Parameters:
        resolutionContext - The resolution context
        context - The bean context
        propertyType - The required property type
        propertyPath - The property path
        Returns:
        An optional value
      • containsValueForField

        @Internal
        @Deprecated
        protected final boolean containsValueForField​(BeanResolutionContext resolutionContext,
                                                      BeanContext context,
                                                      int fieldIndex,
                                                      boolean isValuePrefix)
        Deprecated.
        Obtains a value for the given field argument.
        Parameters:
        resolutionContext - The resolution context
        context - The bean context
        fieldIndex - The field index
        isValuePrefix - Is value prefix in cases when beans are requested
        Returns:
        True if it does
      • containsProperties

        @Internal
        protected final boolean containsProperties​(BeanResolutionContext resolutionContext,
                                                   BeanContext context)
        If this bean is a ConfigurationProperties bean return whether any properties for it are configured within the context.
        Parameters:
        resolutionContext - the resolution context
        context - The context
        Returns:
        True if it does
      • containsProperties

        @Internal
        protected final boolean containsProperties​(BeanResolutionContext resolutionContext,
                                                   BeanContext context,
                                                   java.lang.String subProperty)
        If this bean is a ConfigurationProperties bean return whether any properties for it are configured within the context.
        Parameters:
        resolutionContext - the resolution context
        context - The context
        subProperty - The subproperty to check
        Returns:
        True if it does
      • getBeansOfTypeForField

        @Internal
        protected final <K,​R extends java.util.Collection<K>> java.lang.Object getBeansOfTypeForField​(BeanResolutionContext resolutionContext,
                                                                                                            BeanContext context,
                                                                                                            int fieldIndex,
                                                                                                            io.micronaut.core.type.Argument<K> genericType,
                                                                                                            Qualifier<K> qualifier)
        Obtains all bean definitions for the field at the given index.
        Type Parameters:
        K - The bean type
        R - The result collection type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        fieldIndex - The field index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getBeanRegistrationsForField

        @Internal
        protected final <K,​R extends java.util.Collection<BeanRegistration<K>>> R getBeanRegistrationsForField​(BeanResolutionContext resolutionContext,
                                                                                                                     BeanContext context,
                                                                                                                     int fieldIndex,
                                                                                                                     io.micronaut.core.type.Argument<K> genericType,
                                                                                                                     Qualifier<K> qualifier)
        Obtains all bean definitions for a field injection point.

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        R - The result collection type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        fieldIndex - The field index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getBeanRegistrationForField

        @Internal
        protected final <K> BeanRegistration<K> getBeanRegistrationForField​(BeanResolutionContext resolutionContext,
                                                                            BeanContext context,
                                                                            int fieldIndex,
                                                                            io.micronaut.core.type.Argument<K> genericType,
                                                                            Qualifier<K> qualifier)
        Obtains a bean registration for a field injection point.

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        fieldIndex - The field index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean registration
      • findBeanForField

        @Internal
        protected final <K> java.util.Optional<K> findBeanForField​(BeanResolutionContext resolutionContext,
                                                                   BeanContext context,
                                                                   int fieldIndex,
                                                                   io.micronaut.core.type.Argument<K> genericType,
                                                                   Qualifier<K> qualifier)
        Obtains a an optional for the field at the given index and the argument at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        fieldIndex - The field index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • getStreamOfTypeForField

        @Internal
        protected final <K> java.util.stream.Stream<K> getStreamOfTypeForField​(BeanResolutionContext resolutionContext,
                                                                               BeanContext context,
                                                                               int fieldIndex,
                                                                               io.micronaut.core.type.Argument<K> genericType,
                                                                               Qualifier<K> qualifier)
        Obtains a bean definition for the field at the given index and the argument at the given index

        Warning: this method is used by internal generated code and should not be called by user code.

        Type Parameters:
        K - The bean type
        Parameters:
        resolutionContext - The resolution context
        context - The context
        fieldIndex - The field index
        genericType - The generic type
        qualifier - The qualifier
        Returns:
        The resolved bean
      • containsPropertiesValue

        @Internal
        protected final boolean containsPropertiesValue​(BeanResolutionContext resolutionContext,
                                                        BeanContext context,
                                                        java.lang.String value)
      • containsPropertyValue

        @Internal
        protected final boolean containsPropertyValue​(BeanResolutionContext resolutionContext,
                                                      BeanContext context,
                                                      java.lang.String value)