Class WebParameterProcessor
- All Implemented Interfaces:
Processor
@QueryParam, @PathParam, @HeaderParam, @CookieParam, or @FormParam.
This processor is necessary for Java-based Fluxzero applications where method parameter names are not retained at runtime (due to type erasure and lack of debug metadata). Without this step, the framework cannot reliably bind path, query, or form parameters to method arguments in web handler methods.
How It Works
During compilation, the processor scans for any methods containing web parameter annotations. For each enclosing
class, it generates a companion _params class (e.g. MyHandler_params) that extends
ParameterRegistry. This generated class maps method signatures to ordered parameter name lists.
At runtime, the framework consults these generated registries to resolve argument names for annotated web handler methods—effectively restoring the parameter names that would otherwise be erased.
Kotlin applications do not require this processor, as parameter names are preserved by default in compiled code.
Example
For a Java method like:@HandleWeb
public String getUser(@PathParam("id") String userId, @QueryParam boolean verbose) {
...
}
the processor will generate:
result.put("getUser(java.lang.String,boolean)", List.of("userId", "verbose"));
Usage
- Automatically registered via
@AutoService(Processor.class) - Triggered by any of the supported parameter annotations
- Works in combination with
ParameterRegistry
- See Also:
-
Field Summary
Fields inherited from class AbstractProcessor
processingEnv -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(ProcessingEnvironment processingEnv) booleanprocess(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) Methods inherited from class AbstractProcessor
getCompletions, getSupportedAnnotationTypes, getSupportedOptions, isInitialized
-
Constructor Details
-
WebParameterProcessor
public WebParameterProcessor()
-
-
Method Details
-
init
- Specified by:
initin interfaceProcessor- Overrides:
initin classAbstractProcessor
-
process
- Specified by:
processin interfaceProcessor- Specified by:
processin classAbstractProcessor
-
getSupportedSourceVersion
- Specified by:
getSupportedSourceVersionin interfaceProcessor- Overrides:
getSupportedSourceVersionin classAbstractProcessor
-