org.apache.tapestry5.internal.services

## Class ServiceInjectionProvider

- java.lang.Object
- - org.apache.tapestry5.internal.services.ServiceInjectionProvider

- All Implemented Interfaces:
    InjectionProvider2

      public class ServiceInjectionProvider
      extends Object
      implements InjectionProvider2

  A very late worker related to the `Inject` annotation that, when all other forms of injection have failed, matches the field type to a service interface.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServiceInjectionProvider(ObjectLocator locator, ComponentClassCache classCache)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `provideInjection(PlasticField field, ObjectLocator locator, MutableComponentModel componentModel)` Perform the injection, if possible.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ServiceInjectionProvider

          public ServiceInjectionProvider(ObjectLocator locator,
                                          ComponentClassCache classCache)

  - ### Method Detail

    - #### provideInjection

          public boolean provideInjection(PlasticField field,
                                          ObjectLocator locator,
                                          MutableComponentModel componentModel)

      Description copied from interface: `InjectionProvider2`
      Perform the injection, if possible. Most often, this will result in a call to `PlasticField.inject(Object)`. The caller is responsible for invoking `PlasticField.claim(Object)`.
      Specified by:
        `provideInjection` in interface `InjectionProvider2`
      Parameters:
        `field` - that has the `Inject` annotation
        `locator` - allows services to be located
        `componentModel` - defines the relevant aspects of the component
      Returns:
        true if an injection has been made (terminates the command chain), false to continue down the chain

5.6.1 - Copyright © 2003-2020 The Apache Software Foundation.