Class WebParameterProcessor

java.lang.Object
javax.annotation.processing.AbstractProcessor
io.fluxcapacitor.javaclient.web.WebParameterProcessor
All Implemented Interfaces:
Processor

@SupportedAnnotationTypes({"io.fluxcapacitor.javaclient.web.QueryParam","io.fluxcapacitor.javaclient.web.PathParam","io.fluxcapacitor.javaclient.web.CookieParam","io.fluxcapacitor.javaclient.web.HeaderParam","io.fluxcapacitor.javaclient.web.FormParam"}) @AutoService(javax.annotation.processing.Processor.class) public class WebParameterProcessor extends AbstractProcessor
Annotation processor that generates parameter name metadata for web request handler methods annotated with @QueryParam, @PathParam, @HeaderParam, @CookieParam, or @FormParam.

This processor is necessary for Java-based Flux Capacitor 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: