Package org.jboss.resteasy.cdi

## Class CdiPropertyInjector

- java.lang.Object
- - org.jboss.resteasy.cdi.CdiPropertyInjector

- All Implemented Interfaces:
    `PropertyInjector`

      public class CdiPropertyInjector
      extends Object
      implements PropertyInjector

  JAX-RS property injection is performed twice on CDI Beans. Firstly by the JaxrsInjectionTarget wrapper and then again by RESTEasy (which operates on Weld proxies instead of the underlying instances). To eliminate this, we enabled the injector only for non-CDI beans (JAX-RS components outside of BDA) or CDI components that are not JAX-RS components.
  Author:
    Jozef Hartinger

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `CdiPropertyInjector​(PropertyInjector delegate, Class<?> clazz, Map<Class<?>,​Type> sessionBeanInterface, javax.enterprise.inject.spi.BeanManager manager)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `CompletionStage<Void>` | `inject​(Object target, boolean unwrapAsync)` | Inject values into annotated properties (fields/setter methods) of the target object.
    `CompletionStage<Void>` | `inject​(HttpRequest request, HttpResponse response, Object target, boolean unwrapAsync)` | Inject values into annotated properties (fields/setter methods) of the target object.
    `String` | `toString()` |

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

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

- - ### Constructor Detail

    - #### CdiPropertyInjector

          public CdiPropertyInjector​(PropertyInjector delegate,
                                     Class<?> clazz,
                                     Map<Class<?>,​Type> sessionBeanInterface,
                                     javax.enterprise.inject.spi.BeanManager manager)

  - ### Method Detail

    - #### inject

          public CompletionStage<Void> inject​(Object target,
                                              boolean unwrapAsync)

      Description copied from interface: `PropertyInjector`
      Inject values into annotated properties (fields/setter methods) of the target object. This method should only be used outside the scope of an HTTP request.
      Specified by:
        `inject` in interface `PropertyInjector`
      Parameters:
        `target` - target object
        `unwrapAsync` - unwrap async
      Returns:
        `CompletionStage` or null if async isn't needed

    - #### inject

          public CompletionStage<Void> inject​(HttpRequest request,
                                              HttpResponse response,
                                              Object target,
                                              boolean unwrapAsync)
                                       throws Failure,
                                              javax.ws.rs.WebApplicationException,
                                              ApplicationException

      Description copied from interface: `PropertyInjector`
      Inject values into annotated properties (fields/setter methods) of the target object. This method should only be used inside the scope of an HTTP request.
      Specified by:
        `inject` in interface `PropertyInjector`
      Parameters:
        `request` - http request
        `response` - http response
        `target` - target object
        `unwrapAsync` - unwrap async
      Returns:
        `CompletionStage` or null if async isn't needed
      Throws:
        `Failure` - if application failure occurred
        `javax.ws.rs.WebApplicationException` - if application exception occurred
        `ApplicationException`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`