Class RestCallTemplate
java.lang.Object
edu.university.ecs.lab.common.models.enums.RestCallTemplate
Enum to represent Spring methodName and HttpMethod combinations and determine HttpMethod from
methodName.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.github.javaparser.ast.CompilationUnitprivate final HttpMethodprivate final com.github.javaparser.ast.expr.MethodCallExprprivate static final Stringprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionRestCallTemplate(com.github.javaparser.ast.expr.MethodCallExpr mce, MethodCall mc, com.github.javaparser.ast.CompilationUnit cu) -
Method Summary
Modifier and TypeMethodDescriptionprivate StringbackupParseURL(com.github.javaparser.ast.expr.Expression exp) Find the URL from the given expression.private static StringShorten URLs to only endpoint querygetHttpFromName(com.github.javaparser.ast.expr.MethodCallExpr mce) Find the RestTemplate by the method name.getHttpMethodForExchange(String arguments) Get the HTTP method for the JSF exchange() method call.private StringparseFieldValue(String fieldName) private StringparseURL(com.github.javaparser.ast.expr.Expression exp) Find the URL from the given expression.private StringpreParseURL(com.github.javaparser.ast.expr.MethodCallExpr mce, MethodCall mc) static StringSimplifies all path arguments to {?}.
-
Field Details
-
REST_OBJECTS
-
REST_METHODS
-
UNKNOWN_VALUE
- See Also:
-
url
-
httpMethod
-
cu
private final com.github.javaparser.ast.CompilationUnit cu -
mce
private final com.github.javaparser.ast.expr.MethodCallExpr mce
-
-
Constructor Details
-
RestCallTemplate
public RestCallTemplate(com.github.javaparser.ast.expr.MethodCallExpr mce, MethodCall mc, com.github.javaparser.ast.CompilationUnit cu)
-
-
Method Details
-
getHttpFromName
Find the RestTemplate by the method name.- Parameters:
mce- the method call- Returns:
- the RestTemplate found (null if not found)
-
getHttpMethodForExchange
Get the HTTP method for the JSF exchange() method call.- Parameters:
arguments- the arguments of the exchange() method- Returns:
- the HTTP method extracted
-
parseURL
Find the URL from the given expression.- Parameters:
exp- the expression to extract url from- Returns:
- the URL found
-
backupParseURL
Find the URL from the given expression.- Parameters:
exp- the expression to extract url from- Returns:
- the URL found
-
cleanURL
Shorten URLs to only endpoint query- Parameters:
str- full url- Returns:
- url query
-
parseFieldValue
-
preParseURL
-
simplifyEndpointURL
Simplifies all path arguments to {?}.- Parameters:
url- the endpoint URL- Returns:
- the simplified endpoint URL
-