@UsesOrderedConfiguration(value=ObjectProvider.class) public interface MasterObjectProvider
ObjectProvider, but allows for the case where no object may be provided. This service is itself a key part of Tapestry's general injection mechanism; it is used when instantiating a service implementation instance, invoking module methods (service builder, decorator, or contribution methods), when autobuilding objects of any type. As of Tapestry 5.3, the MasterObjectProvider allows injection of
OperationTrackeras a special case (not based on a contributed ObjectProvider).
<T> T provide(Class<T> objectType, AnnotationProvider annotationProvider, ObjectLocator locator, boolean required)
ObjectProviderprovided a non-null value, then
ObjectLocator.getService(Class, Class)is invoked (with no marker annotations), to provide a uniquely matching service, or throw a failure exception if no single service can be found.
objectType- the expected object type
annotationProvider- 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 object
locator- locator for the context in which the provider is being used
required- if true (normal case) a value must be provided; if false then it is allowed for no ObjectProvider to provide a value, and this method may return null to indicate the failure
RuntimeException- if the expression can not be evaluated, or the type of object identified is not assignable to the type specified by the objectType parameter
5.6.1 - Copyright © 2003-2020 The Apache Software Foundation.