Class DelegatedInjectionValueParamProvider

java.lang.Object
org.glassfish.jersey.server.internal.inject.DelegatedInjectionValueParamProvider
All Implemented Interfaces:
ValueParamProvider

@Singleton class DelegatedInjectionValueParamProvider extends Object implements ValueParamProvider
Value factory provider that delegates the injection target lookup to the underlying injection provider.
  • Field Details

  • Constructor Details

    • DelegatedInjectionValueParamProvider

      public DelegatedInjectionValueParamProvider(LazyValue<ContextInjectionResolver> resolver, Function<Binding,ForeignDescriptor> foreignDescriptorFactory)
      Injection constructor.
      Parameters:
      resolver - context injection resolver.
      foreignDescriptorFactory - function that is able to create a new foreign descriptor.
  • Method Details

    • getValueProvider

      public Function<ContainerRequest,?> getValueProvider(Parameter parameter)
      Description copied from interface: ValueParamProvider
      Get an injected value provider for the parameter. May return null in case the parameter is not supported by the value provider.
      Specified by:
      getValueProvider in interface ValueParamProvider
      Parameters:
      parameter - parameter requesting the value provider instance.
      Returns:
      injected parameter value provider. Returns null if parameter is not supported.
    • getPriority

      public ValueParamProvider.PriorityType getPriority()
      Description copied from interface: ValueParamProvider
      Gets the priority of this provider.
      Specified by:
      getPriority in interface ValueParamProvider
      Returns:
      the priority of this provider.
      See Also:
    • getInjectee

      private Injectee getInjectee(Parameter parameter)
      Creates a new object Injectee corresponding to the injecting point. The injectee contains basic information about the injection point types and ForeignDescriptor of the underlying DI provider to make delegated injection resolver as simple as possible.
      Parameters:
      parameter - jersey-like parameter corresponding to one resource-method's parameter.
      Returns:
      injectee instance as a source of the information about the injecting point.
    • createDescriptor

      private ForeignDescriptor createDescriptor(Class<?> clazz)
      Method is able to create form incoming class and jersey descriptor a ForeignDescriptor which is provided by underlying DI provider.
      Parameters:
      clazz - class from which jersey-like descriptor is created.
      Returns:
      foreign descriptor of the underlying DI provider.