Package com.codename1.backend.annotations


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.

  • Class
    Description
    Runs this method on another thread; the caller returns at once.
    Asks the build to inject this constructor, field or setter.
    A method of a Configuration class whose return value is a bean.
    Marks a class the build constructs and injects, once per server.
    Constructs this bean only when no other bean has its type.
    Constructs this bean only when a configuration key has a value.
    A class whose Bean methods produce beans.
    Binds a group of configuration keys to the setters of a bean.
    Counts the calls of this method, and separately the calls that threw.
    Connection pool settings, compiled in.
    Maps an HTTP DELETE to this method.
    Accepted for familiarity and otherwise ignored: Async works without it.
    Builds the management endpoints into the server: health, metrics, the Prometheus view, scheduled jobs and managed beans, under /manage.
    Builds the MCP endpoint into the server, serving the application's McpTool methods over Streamable HTTP at /mcp.
    Accepted for familiarity and otherwise ignored: Scheduled works without it.
    Marks a class the backend processors wrote, so a later pass knows its own work.
    Maps an HTTP GET to this method.
    Constructs this bean the first time something calls it, instead of at start-up.
    A getter of a ManagedResource bean published as a gauge.
    A method of a ManagedResource bean that the management endpoint and the development MCP server can invoke.
    Publishes this bean's ManagedAttribute getters as metrics and its ManagedOperation methods as operations -- the JMX model, over OpenTelemetry.
    Names and describes one parameter of an McpTool method.
    Publishes this method of a bean as a tool on the server's MCP endpoint, so an agent can call it.
    Traces this server with OpenTelemetry.
    Maps an HTTP PATCH to this method.
    Binds a {name} segment of the path to this parameter.
    Called once the bean is constructed and every member is injected.
    Maps an HTTP POST to this method.
    Called when the server stops, after it has finished the requests in flight and before the database closes.
    The bean an injection point receives when several have its type and it names none.
    Constructs this bean only when a profile is active.
    What a Transactional method does about a transaction that is already open on the calling thread.
    Maps an HTTP PUT to this method.
    Picks one bean by name where several have the type an injection point asks for.
    A Component in the persistence layer.
    Binds the decoded request body to this parameter.
    Binds a request header to this parameter.
    A path, and optionally a verb, for a controller or one of its methods.
    Binds a query parameter to this parameter.
    Shorthand for @Scope("request").
    The status this method answers with when it returns normally.
    Marks a class whose methods answer HTTP requests.
    Runs this method of a bean on a schedule.
    How many instances of a bean there are, and how long each lives.
    Listener settings, compiled in.
    A Component in the service layer.
    Session settings, compiled in.
    Shorthand for @Scope("session").
    Static file settings, compiled in.
    Which kind of thread runs background work: an Async method or a Scheduled job.
    Records how long each call of this method takes, as a histogram.
    Runs this method -- or every public method of this class -- in a database transaction.
    Injects a configuration value.
    Marks a com.codename1.backend.WebSocket as the endpoint for a path.