@SuppressWarnings("WeakerAccess")
    @Internal
    @UsedByGeneratedCode
    protected final Object getValueForField(BeanResolutionContext resolutionContext, BeanContext context, int fieldIndex) {
        FieldInjectionPoint injectionPoint = fieldInjectionPoints.get(fieldIndex);
        BeanResolutionContext.Path path = resolutionContext.getPath();
        path.pushFieldResolve(this, injectionPoint);
        try {
            if (context instanceof PropertyResolver) {
                final AnnotationMetadata annotationMetadata = injectionPoint.getAnnotationMetadata();
                String valueAnnVal = annotationMetadata.getValue(Value.class, String.class).orElse(null);
                Class<?> fieldType = injectionPoint.getType();
                if (isInnerConfiguration(fieldType)) {
                    Qualifier qualifier = resolveQualifier(resolutionContext, injectionPoint.asArgument(), true);
                    return ((DefaultBeanContext) context).getBean(resolutionContext, fieldType, qualifier);
                } else {
                    String valString = resolvePropertyValueName(resolutionContext, injectionPoint, valueAnnVal, annotationMetadata);
                    Argument fieldArgument = injectionPoint.asArgument();
                    ArgumentConversionContext conversionContext = ConversionContext.of(fieldArgument);
                    Optional value = resolveValue((ApplicationContext) context, conversionContext, valueAnnVal != null, valString);
                    if (fieldType == Optional.class) {
                        return resolveOptionalObject(value);
                    } else {
                        if (value.isPresent()) {
                            return value.get();
                        } else {
                            if (fieldArgument.isDeclaredAnnotationPresent(Nullable.class)) {
                                return null;
                            }
                            throw new DependencyInjectionException(resolutionContext, injectionPoint, "Error resolving field value [" + valString + "]. Property doesn't exist or cannot be converted");
                        }
                    }
                }
            } else {
                throw new DependencyInjectionException(resolutionContext, injectionPoint, "@Value requires a BeanContext that implements PropertyResolver");
            }
        } finally {
            path.pop();
        }
    }
@ SuppressWarnings ( "WeakerAccess" ) @ Internal @ UsedByGeneratedCode protected final Object getValueForField ( BeanResolutionContext resolutionContext , BeanContext context , int fieldIndex ) { FieldInjectionPoint injectionPoint = fieldInjectionPoints . get ( fieldIndex ) ; BeanResolutionContext . Path path = resolutionContext . getPath ( ) ; path . pushFieldResolve ( this , injectionPoint ) ; try { if ( context instanceof PropertyResolver ) { final AnnotationMetadata annotationMetadata = injectionPoint . getAnnotationMetadata ( ) ; String valueAnnVal = annotationMetadata . getValue ( Value . class , String . class ) . orElse ( null ) ; Class < ? > fieldType = injectionPoint . getType ( ) ; if ( isInnerConfiguration ( fieldType ) ) { Qualifier qualifier = resolveQualifier ( resolutionContext , injectionPoint . asArgument ( ) , true ) ; return ( ( DefaultBeanContext ) context ) . getBean ( resolutionContext , fieldType , qualifier ) ; } else { String valString = resolvePropertyValueName ( resolutionContext , injectionPoint , valueAnnVal , annotationMetadata ) ; Argument fieldArgument = injectionPoint . asArgument ( ) ; ArgumentConversionContext conversionContext = ConversionContext . of ( fieldArgument ) ; Optional value = resolveValue ( ( ApplicationContext ) context , conversionContext , valueAnnVal != null , valString ) ; if ( fieldType == Optional . class ) { return resolveOptionalObject ( value ) ; } else { if ( value . isPresent ( ) ) { return value . get ( ) ; } else { if ( fieldArgument . isDeclaredAnnotationPresent ( Nullable . class ) ) { return null ; } throw new DependencyInjectionException ( resolutionContext , injectionPoint , "Error resolving field value [" + valString + "]. Property doesn't exist or cannot be converted" ) ; } } } } else { throw new DependencyInjectionException ( resolutionContext , injectionPoint , "@Value requires a BeanContext that implements PropertyResolver" ) ; } } finally { path . pop ( ) ; } }
Obtains a value for the given field from the bean context
<p>
Warning: this method is used by internal generated code and should not be called by user code.

@param resolutionContext The resolution context
@param context           The context
@param fieldIndex        The index of the field
@return The resolved bean