Class CallToResourceMatcher

java.lang.Object
com.hello2morrow.sonargraph.api.CallToResourceMatcher

public final class CallToResourceMatcher extends Object
  • Method Details

    • removeVariablesFromPath

      public static String removeVariablesFromPath(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, 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 matches
      pathToMatch - the path without variable names
      path - path with variable names
      httpMethodTypes -
      Returns:
      true if webResource matched to one of the provided paths, false otherwise.