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

package com.codename1.backend.annotations

Annotations that turn an ordinary class into an HTTP or websocket endpoint.

Mark a class RestController and its methods with GetMapping, PostMapping and the other verb mappings; bind the request to parameters with PathVariable, RequestParam, RequestHeader and RequestBody. The build reads these annotations and generates the router, so routing is decided at build time rather than by reflection when the server starts. The names follow Spring’s, so the shape reads without learning it first.

Server code: these annotations are read by the backend build and mean nothing in an app.

Types

annotation AsyncRuns this method on another thread; the caller returns at once.
annotation AuthenticationPrincipalBinds a handler parameter to the principal of whoever the request is from: the UserDetails the user store returned at sign-in, usually.
annotation AutowiredAsks the build to inject this constructor, field or setter.
annotation BeanA method of a Configuration class whose return value is a bean.
annotation ComponentMarks a class the build constructs and injects, once per server.
annotation ConditionalOnMissingBeanConstructs this bean only when no other bean has its type.
annotation ConditionalOnPropertyConstructs this bean only when a configuration key has a value.
annotation ConfigurationA class whose Bean methods produce beans.
annotation ConfigurationPropertiesBinds a group of configuration keys to the setters of a bean.
annotation CountedCounts the calls of this method, and separately the calls that threw.
annotation DeleteMappingMaps an HTTP DELETE to this method.
annotation DenyAllLets nobody call this method – or any public method of this class.
annotation GeneratedMarks a class the backend processors wrote, so a later pass knows its own work.
annotation GetMappingMaps an HTTP GET to this method.
annotation LazyConstructs this bean the first time something calls it, instead of at start-up.
annotation ManagedAttributeA getter of a ManagedResource bean published as a gauge.
annotation ManagedOperationA method of a ManagedResource bean that the management endpoint and the development MCP server can invoke.
annotation ManagedResourcePublishes this bean’s ManagedAttribute getters as metrics and its ManagedOperation methods as operations – the JMX model, over OpenTelemetry.
annotation McpParamNames and describes one parameter of an McpTool method.
annotation McpToolPublishes this method of a bean as a tool on the server’s MCP endpoint, so an agent can call it.
annotation OpenTelemetryTraces this server with OpenTelemetry.
annotation OrderWhere a bean stands among the beans of its type: the lower the value, the earlier it comes in a List an injection point receives, and the earlier a SecurityFilterChain is asked whether a request is its own.
annotation PNames a parameter for a PreAuthorize expression, which refers to it as #name.
annotation PatchMappingMaps an HTTP PATCH to this method.
annotation PathVariableBinds a {name} segment of the path to this parameter.
annotation PermitAllLets anyone call this method – or every public method of this class.
annotation PostConstructCalled once the bean is constructed and every member is injected.
annotation PostMappingMaps an HTTP POST to this method.
annotation PreAuthorizeLets this method – or every public method of this class – run only when an expression about the caller holds.
annotation PreDestroyCalled when the server stops, after it has finished the requests in flight and before the database closes.
annotation PrimaryThe bean an injection point receives when several have its type and it names none.
annotation ProfileConstructs this bean only when a profile is active.
enum PropagationWhat a Transactional method does about a transaction that is already open on the calling thread.
annotation PutMappingMaps an HTTP PUT to this method.
annotation QualifierPicks one bean by name where several have the type an injection point asks for.
annotation RequestBodyBinds the decoded request body to this parameter.
annotation RequestHeaderBinds a request header to this parameter.
annotation RequestMappingA path, and optionally a verb, for a controller or one of its methods.
annotation RequestParamBinds a request parameter to this parameter: the query string’s value, or, when the query has none, a field of the form the body carries – application/x-www-form-urlencoded, or a multipart/form-data part that is not a file.
annotation RequestPartBinds one part of a multipart/form-data request body to this parameter.
annotation ResponseStatusThe status this method answers with when it returns normally.
annotation RestControllerMarks a class whose methods answer HTTP requests.
annotation RolesAllowedLets this method – or every public method of this class – run only for a caller holding one of these roles: @RolesAllowed("ADMIN") asks for the authority ROLE_ADMIN.
annotation ScheduledRuns this method of a bean on a schedule.
annotation ScopeHow many instances of a bean there are, and how long each lives.
annotation SecuredLets this method – or every public method of this class – run only for a caller holding one of these authorities, each written in full: @Secured("ROLE_ADMIN").
enum ThreadKindWhich kind of thread runs background work: an Async method or a Scheduled job.
annotation TimedRecords how long each call of this method takes, as a histogram.
annotation TransactionalRuns this method – or every public method of this class – in a database transaction.
annotation ValueInjects a configuration value.
annotation WebSocketMappingMarks a com.codename1.backend.WebSocket as the endpoint for a path.