/** * Determine if the supplied {@link Parameter} can potentially be * autowired from an {@link ApplicationContext}. * <p>Returns {@code true} if the supplied parameter is of type * {@link ApplicationContext} (or a sub-type thereof) or is annotated or * meta-annotated with {@link Autowired @Autowired}, * {@link Qualifier @Qualifier}, or {@link Value @Value}. * @param parameter the parameter whose dependency should be autowired * @param parameterIndex the index of the parameter * @see #resolveDependency */ static boolean isAutowirable(Parameter parameter, int parameterIndex) { if (ApplicationContext.class.isAssignableFrom(parameter.getType())) { return true; } AnnotatedElement annotatedParameter = getEffectiveAnnotatedParameter(parameter, parameterIndex); return (AnnotatedElementUtils.hasAnnotation(annotatedParameter, Autowired.class) || AnnotatedElementUtils.hasAnnotation(annotatedParameter, Qualifier.class) || AnnotatedElementUtils.hasAnnotation(annotatedParameter, Value.class)); }
Parameter parameter, int parameterIndex, Class<?> containingClass, ApplicationContext applicationContext) { AnnotatedElement annotatedParameter = getEffectiveAnnotatedParameter(parameter, parameterIndex); Autowired autowired = AnnotatedElementUtils.findMergedAnnotation(annotatedParameter, Autowired.class); boolean required = (autowired == null || autowired.required());
/** * Determine if the supplied {@link Parameter} can potentially be * autowired from an {@link ApplicationContext}. * <p>Returns {@code true} if the supplied parameter is of type * {@link ApplicationContext} (or a sub-type thereof) or is annotated or * meta-annotated with {@link Autowired @Autowired}, * {@link Qualifier @Qualifier}, or {@link Value @Value}. * @param parameter the parameter whose dependency should be autowired * @param parameterIndex the index of the parameter * @see #resolveDependency */ static boolean isAutowirable(Parameter parameter, int parameterIndex) { if (ApplicationContext.class.isAssignableFrom(parameter.getType())) { return true; } AnnotatedElement annotatedParameter = getEffectiveAnnotatedParameter(parameter, parameterIndex); return (AnnotatedElementUtils.hasAnnotation(annotatedParameter, Autowired.class) || AnnotatedElementUtils.hasAnnotation(annotatedParameter, Qualifier.class) || AnnotatedElementUtils.hasAnnotation(annotatedParameter, Value.class)); }
/** * Determine if the supplied {@link Parameter} can potentially be * autowired from an {@link ApplicationContext}. * <p>Returns {@code true} if the supplied parameter is of type * {@link ApplicationContext} (or a sub-type thereof) or is annotated or * meta-annotated with {@link Autowired @Autowired}, * {@link Qualifier @Qualifier}, or {@link Value @Value}. * @param parameter the parameter whose dependency should be autowired * @param parameterIndex the index of the parameter * @see #resolveDependency */ static boolean isAutowirable(Parameter parameter, int parameterIndex) { if (ApplicationContext.class.isAssignableFrom(parameter.getType())) { return true; } AnnotatedElement annotatedParameter = getEffectiveAnnotatedParameter(parameter, parameterIndex); return (AnnotatedElementUtils.hasAnnotation(annotatedParameter, Autowired.class) || AnnotatedElementUtils.hasAnnotation(annotatedParameter, Qualifier.class) || AnnotatedElementUtils.hasAnnotation(annotatedParameter, Value.class)); }
Parameter parameter, int parameterIndex, Class<?> containingClass, ApplicationContext applicationContext) { AnnotatedElement annotatedParameter = getEffectiveAnnotatedParameter(parameter, parameterIndex); Autowired autowired = AnnotatedElementUtils.findMergedAnnotation(annotatedParameter, Autowired.class); boolean required = (autowired == null || autowired.required());
Parameter parameter, int parameterIndex, Class<?> containingClass, ApplicationContext applicationContext) { AnnotatedElement annotatedParameter = getEffectiveAnnotatedParameter(parameter, parameterIndex); Autowired autowired = AnnotatedElementUtils.findMergedAnnotation(annotatedParameter, Autowired.class); boolean required = (autowired == null || autowired.required());