Package com.hello2morrow.sonargraph.api
Class CallToResourceMatcher
- java.lang.Object
-
- com.hello2morrow.sonargraph.api.CallToResourceMatcher
-
public final class CallToResourceMatcher extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static boolean
match(IGenericProgrammingElementAccess webResource, java.lang.String pathToMatch, java.lang.String path, java.util.List<java.lang.String> httpMethodTypes)
Matches a given webResource against call path (with and without variable names).static java.lang.String
removeVariablesFromPath(java.lang.String path)
This method removes all characters between curly brackes, e.g.
-
-
-
Method Detail
-
removeVariablesFromPath
public static java.lang.String removeVariablesFromPath(java.lang.String path)
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, java.lang.String pathToMatch, java.lang.String path, java.util.List<java.lang.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.
-
-