isAutowirable, resolveDependency
| Modifier and Type | Field and Description |
|---|---|
| private static final AnnotatedElement |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private static AnnotatedElement | Returns: the suppliedparameter or the effective Parameter
if the aforementioned bug is in effectDue to a bug in |
| public static boolean | isAutowirable(Parameter
the parameter whose dependency should be autowired
(must not be parameter, int null)the index of the parameter in the constructor or method
that declares the parameter parameterIndex)Determine if the supplied |
| public static Object | Returns: the resolved object, ornull if none foundthe parameter whose dependency should be resolved (must not be
parameter, int null)the index of the parameter in the constructor or method
that declares the parameter parameterIndex, Class<?> the concrete class that contains the parameter; this may
differ from the class that declares the parameter in that it may be a subclass
thereof, potentially substituting type variables (must not be containingClass, AutowireCapableBeanFactory null)the beanFactory)AutowireCapableBeanFactory from which to resolve
the dependency (must not be null)Resolve the dependency for the supplied |
| EMPTY_ANNOTATED_ELEMENT | back to summary |
|---|---|
| private static final AnnotatedElement EMPTY_ANNOTATED_ELEMENT | |
| ParameterResolutionDelegate | back to summary |
|---|---|
| private ParameterResolutionDelegate() | |
| getEffectiveAnnotatedParameter | back to summary |
|---|---|
| private static AnnotatedElement getEffectiveAnnotatedParameter(Parameter parameter, int index) Due to a bug in Note Since Spring 6 may still encounter user code compiled with
Bug in javac in JDK < 9The parameter annotations array in the compiled byte code excludes an entry for the implicit enclosing instance parameter for an inner class constructor. WorkaroundThis method provides a workaround for this off-by-one error by allowing the
caller to access annotations on the preceding WARNINGThe
| |
| isAutowirable | back to summary |
|---|---|
| public static boolean isAutowirable(Parameter parameter, int parameterIndex) Determine if the supplied Returns Note that
| |
| resolveDependency | back to summary |
|---|---|
| public static Object resolveDependency(Parameter parameter, int parameterIndex, Class<?> containingClass, AutowireCapableBeanFactory beanFactory) throws BeansException Resolve the dependency for the supplied Provides comprehensive autowiring support for individual method parameters
on par with Spring's dependency injection facilities for autowired fields and
methods, including support for The dependency is required unless the parameter is annotated or meta-annotated
with If an explicit qualifier is not declared, the name of the parameter will be used as the qualifier for resolving ambiguities.
| |