Class ResourceElementResolver
java.lang.Object
org.springframework.context.annotation.ResourceElementResolver
Resolver for the injection of named beans on a field or method element,
 following the rules of the 
Resource annotation
 but without any JNDI support. This is primarily intended for AOT processing.- Since:
- 6.1.2
- Author:
- Stephane Nicoll, Juergen Hoeller
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionstatic ResourceElementResolverCreate a newResourceElementResolver.ResourceFieldResolverfor the specified field.static ResourceElementResolverCreate a newResourceElementResolver.ResourceFieldResolverfor the specified field and resource name.static ResourceElementResolverCreate a newResourceElementResolver.ResourceMethodResolverfor the specified method using a resource name that infers from the method name.static ResourceElementResolverCreate a newResourceElementResolver.ResourceMethodResolverfor the specified method and resource name.<T> @Nullable Tresolve(RegisteredBean registeredBean) Resolve the value for the specified registered bean.abstract voidresolveAndSet(RegisteredBean registeredBean, Object instance) Resolve the value for the specified registered bean and set it using reflection.
- 
Method Details- 
forFieldCreate a newResourceElementResolver.ResourceFieldResolverfor the specified field.- Parameters:
- fieldName- the field name
- Returns:
- a new ResourceElementResolver.ResourceFieldResolverinstance
 
- 
forFieldCreate a newResourceElementResolver.ResourceFieldResolverfor the specified field and resource name.- Parameters:
- fieldName- the field name
- resourceName- the resource name
- Returns:
- a new ResourceElementResolver.ResourceFieldResolverinstance
 
- 
forMethodCreate a newResourceElementResolver.ResourceMethodResolverfor the specified method using a resource name that infers from the method name.- Parameters:
- methodName- the method name
- parameterType- the parameter type.
- Returns:
- a new ResourceElementResolver.ResourceMethodResolverinstance
 
- 
forMethodpublic static ResourceElementResolver forMethod(String methodName, Class<?> parameterType, String resourceName) Create a newResourceElementResolver.ResourceMethodResolverfor the specified method and resource name.- Parameters:
- methodName- the method name
- parameterType- the parameter type
- resourceName- the resource name
- Returns:
- a new ResourceElementResolver.ResourceMethodResolverinstance
 
- 
resolveResolve the value for the specified registered bean.- Parameters:
- registeredBean- the registered bean
- Returns:
- the resolved field or method parameter value
 
- 
resolveAndSetResolve the value for the specified registered bean and set it using reflection.- Parameters:
- registeredBean- the registered bean
- instance- the bean instance
 
 
-