java.lang.Object
org.omnifaces.cdi.param.ParamExtension
- All Implemented Interfaces:
Extension
CDI extension that works around the fact that CDI insists on doing absolutely guaranteed type safe injections. While generally applaudable this unfortunately
impedes writing true generic producers that dynamically do conversion based on the target type.
This extension collects the target types of each injection point qualified with the @Param annotation and dynamically registers
Beans that effectively represents producers for each type.
Since OmniFaces 3.6, this extension also scans for @Param without @Inject and manually takes care of them
while creating the bean.
- Since:
- 2.0
- Author:
- Arjan Tijms
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> voidcollectParams(ProcessInjectionTarget<T> event) Collect fields annotated withParam.voidstatic <T> voidprocessParamsWithoutInject(ProcessInjectionTarget<T> event, Set<AnnotatedField<?>> paramsWithoutInject) Deprecated, for removal: This API element is subject to removal in a future version.Since OmniFaces 5.4.
-
Constructor Details
-
ParamExtension
public ParamExtension()
-
-
Method Details
-
collectParams
Collect fields annotated withParam.- Type Parameters:
T- The generic injection target type.- Parameters:
event- The process injection target event.
-
processParamsWithInject
- Parameters:
event- The after bean discovery event.
-
processParamsWithoutInject
@Deprecated(since="5.4", forRemoval=true) public static <T> void processParamsWithoutInject(ProcessInjectionTarget<T> event, Set<AnnotatedField<?>> paramsWithoutInject) Deprecated, for removal: This API element is subject to removal in a future version.
-