Interface ObjectProvider

    • Method Detail

      • provide

        <T> T provide​(Class<T> objectType,
                      AnnotationProvider annotationProvider,
                      ObjectLocator locator)
        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.
        Type Parameters:
        T -
        Parameters:
        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
        Returns:
        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 not assignable to the type specified by the objectType parameter