Java: some clean-up and refactoring

This commit is contained in:
Jami Cogswell
2024-12-19 20:20:09 -05:00
parent d4114f66c2
commit 20e8eb4323
2 changed files with 66 additions and 28 deletions

View File

@@ -156,6 +156,11 @@ class SpringRequestMappingMethod extends SpringControllerMethod {
/** Gets the "value" @RequestMapping annotation value, if present. */
string getValue() { result = requestMappingAnnotation.getStringValue("value") }
/** Gets the "method" @RequestMapping annotation value, if present. */
string getMethod() {
result = requestMappingAnnotation.getAnEnumConstantArrayValue("method").getName()
}
/** Holds if this is considered an `@ResponseBody` method. */
predicate isResponseBody() {
this.getAnAnnotation().getType() instanceof SpringResponseBodyAnnotationType or