@SuppressWarnings({"unused", "unchecked"})
    @Internal
    protected final Object getValueForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex) {
        MethodInjectionPoint injectionPoint = methodInjectionPoints.get(methodIndex);
        Argument argument = injectionPoint.getArguments()[argIndex];
        BeanResolutionContext.Path path = resolutionContext.getPath();
        path.pushMethodArgumentResolve(this, injectionPoint, argument);
        if (context instanceof ApplicationContext) {
            // can't use orElseThrow here due to compiler bug
            try {
                String valueAnnStr = argument.getAnnotationMetadata().getValue(Value.class, String.class).orElse(null);
                Class argumentType = argument.getType();

                if (isInnerConfiguration(argumentType)) {
                    Qualifier qualifier = resolveQualifier(resolutionContext, argument, true);
                    return ((DefaultBeanContext) context).getBean(resolutionContext, argumentType, qualifier);
                } else {
                    String argumentName = argument.getName();
                    String valString = resolvePropertyValueName(resolutionContext, injectionPoint.getAnnotationMetadata(), argument, valueAnnStr);


                    ApplicationContext applicationContext = (ApplicationContext) context;
                    ArgumentConversionContext conversionContext = ConversionContext.of(argument);
                    Optional value = resolveValue(applicationContext, conversionContext, valueAnnStr != null, valString);
                    if (argumentType == Optional.class) {
                        return resolveOptionalObject(value);
                    } else {
                        if (value.isPresent()) {
                            return value.get();
                        } else {
                            if (argument.isDeclaredAnnotationPresent(Nullable.class)) {
                                return null;
                            }
                            throw new DependencyInjectionException(resolutionContext, injectionPoint, conversionContext, valString);
                        }
                    }
                }
            } finally {
                path.pop();
            }
        } else {
            path.pop();
            throw new DependencyInjectionException(resolutionContext, argument, "BeanContext must support property resolution");
        }
    }
@ SuppressWarnings ( { "unused" , "unchecked" } ) @ Internal protected final Object getValueForMethodArgument ( BeanResolutionContext resolutionContext , BeanContext context , int methodIndex , int argIndex ) { MethodInjectionPoint injectionPoint = methodInjectionPoints . get ( methodIndex ) ; Argument argument = injectionPoint . getArguments ( ) [ argIndex ] ; BeanResolutionContext . Path path = resolutionContext . getPath ( ) ; path . pushMethodArgumentResolve ( this , injectionPoint , argument ) ; if ( context instanceof ApplicationContext ) { try { String valueAnnStr = argument . getAnnotationMetadata ( ) . getValue ( Value . class , String . class ) . orElse ( null ) ; Class argumentType = argument . getType ( ) ; if ( isInnerConfiguration ( argumentType ) ) { Qualifier qualifier = resolveQualifier ( resolutionContext , argument , true ) ; return ( ( DefaultBeanContext ) context ) . getBean ( resolutionContext , argumentType , qualifier ) ; } else { String argumentName = argument . getName ( ) ; String valString = resolvePropertyValueName ( resolutionContext , injectionPoint . getAnnotationMetadata ( ) , argument , valueAnnStr ) ; ApplicationContext applicationContext = ( ApplicationContext ) context ; ArgumentConversionContext conversionContext = ConversionContext . of ( argument ) ; Optional value = resolveValue ( applicationContext , conversionContext , valueAnnStr != null , valString ) ; if ( argumentType == Optional . class ) { return resolveOptionalObject ( value ) ; } else { if ( value . isPresent ( ) ) { return value . get ( ) ; } else { if ( argument . isDeclaredAnnotationPresent ( Nullable . class ) ) { return null ; } throw new DependencyInjectionException ( resolutionContext , injectionPoint , conversionContext , valString ) ; } } } } finally { path . pop ( ) ; } } else { path . pop ( ) ; throw new DependencyInjectionException ( resolutionContext , argument , "BeanContext must support property resolution" ) ; } }
Obtains a value for the given method argument.

@param resolutionContext The resolution context
@param context           The bean context
@param methodIndex       The method index
@param argIndex          The argument index
@return The value