; Java entry-point detection queries
; Captures: @node (declaration), @name (class/method name)

; public static void main(String[] args)
(method_declaration
  (modifiers) @_mods
  type: (void_type)
  name: (identifier) @name
  (#eq? @name "main")
  (#match? @_mods "public")
  (#match? @_mods "static")) @node

; @SpringBootApplication class
(class_declaration
  (modifiers
    (marker_annotation
      name: (identifier) @_ann
      (#eq? @_ann "SpringBootApplication")))
  name: (identifier) @name) @node

; @RestController / @Controller class
(class_declaration
  (modifiers
    (marker_annotation
      name: (identifier) @_ann
      (#match? @_ann "^(RestController|Controller)$")))
  name: (identifier) @name) @node
