| org.apache.tapestry.ioc.ObjectProvider
All known Subclasses: org.apache.tapestry.ioc.internal.services.ValueObjectProvider, org.apache.tapestry.internal.services.AssetObjectProvider, org.apache.tapestry.ioc.internal.services.SymbolObjectProvider, org.apache.tapestry.internal.services.ServiceAnnotationObjectProvider, org.apache.tapestry.internal.services.AliasImpl,
ObjectProvider | public interface ObjectProvider (Code) | | Object providers represent an alternate way to locate an object provided somewhere in the
org.apache.tapestry.ioc.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.
A default ObjectProvider uses
ObjectLocator.getService(Class) .
|
provide | T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator)(Code) | | Provides an object based on an expression. The process of providing objects occurs within a
particular context, which will typically be a service builder method, service
contributor method, or service decorator method. The locator parameter provides access to the
services visible to that context.
Parameters: objectType - the expected object type Parameters: annotationProvider - provides access to annotations (typically, the field or parameter to which aninjection-related annotation is attached); annotations on the field or parametermay also be used when resolving the desired object Parameters: locator - locator for the context in which the provider is being used< Parameters: T - > the requested object, or null if this object provider can not supply an object throws: RuntimeException - if the expression can not be evaluated, or the type of object identified is notassignable to the type specified by the objectType parameter |
|
|