public class AutowiredResourceInjector extends AbstractResourceInjector
@Inject are evaluated. If that method has a single parameter, a Resource of that type
is injected into it, if present.
Unlike the SimpleResourceInjector, changes in the provided Iterable are reflected in this injector.
| Constructor and Description |
|---|
AutowiredResourceInjector(Iterable<?> resources)
Initializes the resource injector to inject to given
resources. |
| Modifier and Type | Method and Description |
|---|---|
protected <R> Optional<R> |
findResource(Class<R> requiredType)
Returns a resource of given
requiredType or an empty Optional if the resource is not registered with the
injector. |
injectorAnnotationNames, injectResourcespublic AutowiredResourceInjector(Iterable<?> resources)
resources.resources - The resources to injectprotected <R> Optional<R> findResource(Class<R> requiredType)
AbstractResourceInjectorrequiredType or an empty Optional if the resource is not registered with the
injector.findResource in class AbstractResourceInjectorR - the resource typerequiredType - the class of the resource to findCopyright © 2010–2018. All rights reserved.