Analyzer::Java::HttpServer
Inherits Analyzer < FileHelper < Reference < Object
JDK built-in HTTP server (com.sun.net.httpserver.HttpServer,
jdk.httpserver module, available since Java 6). Routes are
registered with server.createContext("/path", handler), where the
handler is a lambda, an HttpHandler instance/anonymous class, or a
method reference.
Unlike declarative frameworks the HTTP verb is not bound at
registration — handlers branch on exchange.getRequestMethod() — so
this analyzer recovers the path from the createContext call and the
verb(s)/params from the resolved handler body. When the handler is a
named/anonymous HttpHandler, its handle(...) body is resolved
within the same file (cross-file handler classes are out of scope,
mirroring the other JVM extractors).
Reference: https://docs.oracle.com/en/java/javase/21/docs/api/jdk.httpserver/com/sun/net/httpserver/HttpServer.html
Constants
Verbs that carry a request body — the body param is attached only to these so a method-dispatching handler doesn't surface a body on its GET branch.
A case label group: one or more verb literals (Java allows
case "GET", "HEAD":) terminated by a colon or an arrow (Java 14+
case "GET" -> ...).
getRequestMethod() verb comparisons. Hoisted as constants because
interpolated regexes recompile on every evaluation.
Class methods
Instance methods
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.