Class ControllerScanner
java.lang.Object
com.arc_e_tect.gradle.shadow.scan.ControllerScanner
Parses Java source files and collects every HTTP endpoint exposed by a Spring
@RestController class.
Recognises the class-level @RequestMapping base path plus the standard method-level
mapping annotations: @RequestMapping, @GetMapping, @PostMapping,
@PutMapping, @DeleteMapping, and @PatchMapping. When a
@RequestMapping method annotation does not restrict its method attribute, the
resulting Endpoint carries HttpVerb.ANY.
Annotations are matched by simple name, so both the standard
org.springframework.web.bind.annotation imports and any fully-qualified usage are
recognised without requiring Spring on the scanner's own classpath.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ControllerScanner
public ControllerScanner()Creates a newControllerScanner.
-
-
Method Details
-
scan
Scans one.javasource file and returns every endpoint exposed by every@RestControllerclass it declares.- Parameters:
sourceFile- the file to parse- Returns:
- possibly-empty list of endpoints, never
null - Throws:
IOException- if the file cannot be read
-