org.springframework.beans.factory.support

Interface AutowireCandidateResolver

    • Method Detail

      • isAutowireCandidate

        default boolean isAutowireCandidate(BeanDefinitionHolder bdHolder,
                                            DependencyDescriptor descriptor)
        Determine whether the given bean definition qualifies as an autowire candidate for the given dependency.

        The default implementation checks BeanDefinition.isAutowireCandidate().

        Parameters:
        bdHolder - the bean definition including bean name and aliases
        descriptor - the descriptor for the target method parameter or field
        Returns:
        whether the bean definition qualifies as autowire candidate
        See Also:
        BeanDefinition.isAutowireCandidate()
      • isRequired

        default boolean isRequired(DependencyDescriptor descriptor)
        Determine whether the given descriptor is effectively required.

        The default implementation checks DependencyDescriptor.isRequired().

        Parameters:
        descriptor - the descriptor for the target method parameter or field
        Returns:
        whether the descriptor is marked as required or possibly indicating non-required status some other way (e.g. through a parameter annotation)
        Since:
        5.0
        See Also:
        DependencyDescriptor.isRequired()
      • getSuggestedValue

        @Nullable
        default java.lang.Object getSuggestedValue(DependencyDescriptor descriptor)
        Determine whether a default value is suggested for the given dependency.

        The default implementation simply returns null.

        Parameters:
        descriptor - the descriptor for the target method parameter or field
        Returns:
        the value suggested (typically an expression String), or null if none found
        Since:
        3.0
      • getLazyResolutionProxyIfNecessary

        @Nullable
        default java.lang.Object getLazyResolutionProxyIfNecessary(DependencyDescriptor descriptor,
                                                                             @Nullable
                                                                             java.lang.String beanName)
        Build a proxy for lazy resolution of the actual dependency target, if demanded by the injection point.

        The default implementation simply returns null.

        Parameters:
        descriptor - the descriptor for the target method parameter or field
        beanName - the name of the bean that contains the injection point
        Returns:
        the lazy resolution proxy for the actual dependency target, or null if straight resolution is to be performed
        Since:
        4.0