Class DelegatedInjectionValueParamProvider
java.lang.Object
org.glassfish.jersey.server.internal.inject.DelegatedInjectionValueParamProvider
- All Implemented Interfaces:
ValueParamProvider
Value factory provider that delegates the injection target lookup to the underlying injection provider.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.glassfish.jersey.server.spi.internal.ValueParamProvider
ValueParamProvider.Priority, ValueParamProvider.PriorityType
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Cache
<Parameter, ForeignDescriptor> We do not want to create a new descriptor instance for every and each method invocation.private final Function
<Binding, ForeignDescriptor> private final LazyValue
<ContextInjectionResolver> -
Constructor Summary
ConstructorsConstructorDescriptionDelegatedInjectionValueParamProvider
(LazyValue<ContextInjectionResolver> resolver, Function<Binding, ForeignDescriptor> foreignDescriptorFactory) Injection constructor. -
Method Summary
Modifier and TypeMethodDescriptionprivate ForeignDescriptor
createDescriptor
(Class<?> clazz) Method is able to create form incoming class andjersey descriptor
aForeignDescriptor
which is provided by underlying DI provider.private Injectee
getInjectee
(Parameter parameter) Creates a new objectInjectee
corresponding to the injecting point.Gets the priority of this provider.getValueProvider
(Parameter parameter) Get an injected value provider for the parameter.
-
Field Details
-
resolver
-
foreignDescriptorFactory
-
descriptorCache
We do not want to create a new descriptor instance for every and each method invocation. If the underlying DI descriptorForeignDescriptor
is already created for the givenParameter
then used the already created descriptor.
-
-
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
Description copied from interface:ValueParamProvider
Get an injected value provider for the parameter. May returnnull
in case the parameter is not supported by the value provider.- Specified by:
getValueProvider
in interfaceValueParamProvider
- Parameters:
parameter
- parameter requesting the value provider instance.- Returns:
- injected parameter value provider. Returns
null
if parameter is not supported.
-
getPriority
Description copied from interface:ValueParamProvider
Gets the priority of this provider.- Specified by:
getPriority
in interfaceValueParamProvider
- Returns:
- the priority of this provider.
- See Also:
-
getInjectee
Creates a new objectInjectee
corresponding to the injecting point. The injectee contains basic information about the injection point types andForeignDescriptor
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
Method is able to create form incoming class andjersey descriptor
aForeignDescriptor
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.
-