Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

@Retention(CLASS) @Target({PARAMETER})

public @interface RequestParam

Binds a query parameter to this parameter.

A missing value binds to the default below, or to null when the parameter is not required. It is never a server error unless required says so.

Methods

public abstract String value()The name to bind from.
public abstract boolean required() default trueWhether a request without it is rejected.
public abstract String defaultValue() default ""Used when the request omits it.

Method details

value

public abstract String value()
The name to bind from. REQUIRED, and deliberately so: it cannot default to the parameter’s own name because a Java parameter name only survives compilation when the application is built with -parameters, which is the application’s build to decide and not this one’s. An annotation that promised the default would compile fine and then fail at packaging, for every developer who took it at its word.

required

public abstract boolean required() default true
Whether a request without it is rejected.

defaultValue

public abstract String defaultValue() default ""
Used when the request omits it.