Annotation Type RouteParam
Binds a constructor or static-factory parameter to a path variable or query parameter from an incoming deep link.
Used together with Route. The build-time route processor inspects each
annotated parameter and generates dispatch code that pulls the value out of
the matched URL before invoking the constructor or factory.
@Route("/users/:id")
public class ProfileForm extends Form {
public ProfileForm(@RouteParam("id") String id) { ... }
}
@Route("/search")
public static Form search(@RouteParam("q") String query,
@RouteParam(value = "page", required = false) String page) { ... }
The value is matched first against named path variables (:name) and then
against query-string keys. The annotation is required on every parameter the
framework should bind; unannotated parameters are an error at build time.
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionbooleanWhen true (the default) the build fails if the deep link cannot supply a value.
-
Element Details
-
value
String valueThe name of the path variable or query parameter to bind. Required. -
required
boolean requiredWhen true (the default) the build fails if the deep link cannot supply a value. When false a missing value is passed in as null.- Default:
true
-