class
Analyzer::Java::Spring
- Analyzer::Java::Spring
- Analyzer
- Reference
- Object
Defined in:
analyzer/analyzers/java/spring.crConstant Summary
-
ANY_BINDING_RE =
Regex.union(SPRING_WEB_BIND_PACKAGE, FEIGN_CLIENT_PACKAGE, "@FeignClient", SPRING_HTTP_EXCHANGE_PACKAGE, "@HttpExchange", "@GetExchange", "@PostExchange", "@PutExchange", "@PatchExchange", "@DeleteExchange", "RouteLocatorBuilder", "PredicateSpec", "org.springframework.cloud.gateway", "org.springframework.web.socket.config.annotation", "WebSocketMessageBrokerConfigurer", "@EnableWebSocketMessageBroker", "org.springframework.messaging.handler.annotation", "@MessageMapping", "@SubscribeMapping", "ResourceHandlerRegistry", "addResourceHandler") -
The OR of every marker the annotation branch keys off. A file that misses this cannot set any of the individual flags, so the per-flag scans only run for the handful of files that get past it.
-
FEIGN_CLIENT_PACKAGE =
"org.springframework.cloud.openfeign.FeignClient" -
INTERFACE_OR_ABSTRACT_RE =
Regex.union("interface", "abstract") -
collect_interface_route_indexgates. -
INTERFACE_ROUTE_MARKER_RE =
Regex.union(SPRING_WEB_BIND_PACKAGE, SPRING_HTTP_EXCHANGE_PACKAGE, "@HttpExchange", "@GetExchange", "@PostExchange", "@PutExchange", "@PatchExchange", "@DeleteExchange", "@RequestMapping", "@GetMapping", "@PostMapping") -
MESSAGE_MAPPING_BINDING_RE =
Regex.union("org.springframework.messaging.handler.annotation", "@MessageMapping", "@SubscribeMapping") -
META_ANNOTATION_RE =
Regex.union("@interface") -
REGEX_ROUTE_CALL =
/((?:andRoute|route)\s*\(|\.)\s*(?:RequestPredicates\.)?(GET|POST|DELETE|PUT|PATCH|HEAD|OPTIONS)\s*\(/ -
REGEX_ROUTER_CODE_BLOCK =
/route\(\)?.*?\);/m -
RESOURCE_HANDLER_BINDING_RE =
Regex.union("ResourceHandlerRegistry", "addResourceHandler") -
SPRING_HTTP_EXCHANGE_PACKAGE =
"org.springframework.web.service.annotation." -
SPRING_INDEX_PRESCREEN_RE =
Regex.union("setApplicationDestinationPrefixes", SPRING_WEB_BIND_PACKAGE) -
SPRING_WEB_BIND_PACKAGE =
"org.springframework.web.bind.annotation." -
SPRING_WEB_BIND_RE =
Regex.union(SPRING_WEB_BIND_PACKAGE) -
STOMP_PREFIX_RE =
Regex.union("setApplicationDestinationPrefixes") -
build_spring_indexesgate: neither index can want a file that mentions neither marker. -
WEBSOCKET_BINDING_RE =
Regex.union("org.springframework.web.socket.config.annotation", "WebSocketMessageBrokerConfigurer", "@EnableWebSocketMessageBroker") -
Every
content.includes?(...)below used to be its own Rabin-Karp pass over the whole file. This analyzer asks ~30 such questions per.javafile across three walks, and on a monorepo the overwhelming majority of files answer "no" to all of them. One precompiledRegex.union(PCRE2 JIT, viacontent_matches?) is the same predicate in a single pass — see the note onAnalyzer#content_matches?.