Class 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.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 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.