public interface ObjectProvider
Registry
. Instead of using a just the service id to gain access to a service within the
Registry, object providers in different flavors are capable of vending, or even creating, objects of disparate types
from disparate sources.
Object providers are consulted in a strict order, and the first non-null result is taken.
In many cases, an object provider searches for additional annotations on the element (usually a parameter, or perhaps
a field) for which a value is required.Modifier and Type | Method and Description |
---|---|
<T> T |
provide(Class<T> objectType,
AnnotationProvider annotationProvider,
ObjectLocator locator)
Provides an object based on an expression.
|
<T> T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator)
T
- objectType
- the expected object typeannotationProvider
- provides access to annotations (typically, the field or parameter to which an
injection-related annotation is attached); annotations on the field or parameter may
also be used when resolving the desired objectlocator
- locator for the context in which the provider is being usedRuntimeException
- if the expression can not be evaluated, or the type of object identified is not
assignable to the type specified by the objectType parameter${project.version} - Copyright © 2003-2015 The Apache Software Foundation.