Package com.hello2morrow.sonargraph.api
Class CallToResourceMatcher
java.lang.Object
com.hello2morrow.sonargraph.api.CallToResourceMatcher
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanmatch(IGenericProgrammingElementAccess webResource, String pathToMatch, String path, List<String> httpMethodTypes) Matches a given webResource against call path (with and without variable names).static StringThis method removes all characters between curly brackes, e.g.
-
Method Details
-
removeVariablesFromPath
This method removes all characters between curly brackes, e.g. /account/{name}/ is converted to /account/{}/. These converted paths can then be used for matching, since variable names can be different. -
match
public static boolean match(IGenericProgrammingElementAccess webResource, String pathToMatch, String path, List<String> httpMethodTypes) Matches a given webResource against call path (with and without variable names).- Parameters:
webResource- the webResource to be matchespathToMatch- the path without variable namespath- path with variable nameshttpMethodTypes-- Returns:
- true if webResource matched to one of the provided paths, false otherwise.
-