class

Analyzer::Java::Spark

Inherits Analyzer < FileHelper < Reference < Object

Spark Java is Sinatra-flavoured: Spark.get("/x", (req, res) -> ...) (or just get("/x", ...) after import static spark.Spark.*). Path nesting is path("/api", () -> { ... }). The shared lambda-DSL extractor handles all of that; this analyzer just supplies the Spark method-name set.

Constants

CONFIG = Noir::TreeSitterJvmLambdaDslExtractor::Config.new(verb_methods: {"get" => "GET", "post" => "POST", "put" => "PUT", "delete" => "DELETE", "patch" => "PATCH", "head" => "HEAD", "options" => "OPTIONS", "trace" => "TRACE", "connect" => "CONNECT", "any" => "ANY"}, nest_methods: Set {"path"}, transparent_methods: Set {"before", "after", "afterAfter"}, query_methods: Set {"queryParams", "queryParamOrDefault", "queryParamsValues", "queryMap"}, header_methods: Set {"headers"}, cookie_methods: Set {"cookie"}, body_methods: Set {"body", "bodyAsBytes"}, websocket_methods: Set {"webSocket"}, router_receivers: Set {"redirect"})

Spark's request helpers. body() returns the raw body string (no type info) — emit a generic body param. queryParams serves both query string and form data; we surface it as query since Spark callers most commonly read it that way.

JAVA_EXTENSION = "java"
SPARK_MARKERS = ["spark.Spark", "import static spark.", "import spark."]

Class methods

tech_name
Source

Instance methods

analyze
Source
tech

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.

Source