public class SimpleResourceInjector extends AbstractResourceInjector
Constructor and Description |
---|
SimpleResourceInjector(Collection<?> resources)
Initializes the resource injector to inject to given
resources . |
SimpleResourceInjector(Object... 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, injectResources
public SimpleResourceInjector(Object... resources)
resources
.resources
- The resources to injectpublic SimpleResourceInjector(Collection<?> resources)
resources
.
Note that any changes to the given collection will not be reflected by this injector.
resources
- The resources to injectprotected <R> Optional<R> findResource(Class<R> requiredType)
AbstractResourceInjector
requiredType
or an empty Optional if the resource is not registered with the
injector.findResource
in class AbstractResourceInjector
R
- the resource typerequiredType
- the class of the resource to findCopyright © 2010–2019. All rights reserved.