Class ViewPattern

    • Method Detail

      • getWeight

        public int getWeight()
        Gets the weight of this ViewPattern. If more than one ViewPattern matches the requested URL, the one with the highest weight is taken.
        Returns:
        weight
      • getPattern

        public String getPattern()
        Gets the view's URL pattern.
        Returns:
        URL pattern
      • getRegEx

        @Nonnull
        public Pattern getRegEx()
        Gets a regular expression Pattern to match a URL against this ViewPattern. This regular expression can be used to quickly find view candidates for a request URL.
        Returns:
        regular expression Pattern.
      • getExpression

        @Nonnull
        public List<org.springframework.expression.Expression> getExpression()
        Returns an Expression for each placeholder in the pattern. The expressions are used for building an URL to this view.
        Returns:
        List of Expression
      • getParameters

        @Nonnull
        public List<StringgetParameters()
        Returns a list of parameter strings for each placeholder in the pattern.
        Returns:
        List of parameters
      • getQualifier

        public String getQualifier()
        Returns the qualifier of this pattern.
        Returns:
        Qualifier of this pattern, or null for the default qualifier.
      • matches

        public boolean matches​(String path)
        Matches the requested URL against this ViewPattern.
        Parameters:
        path - the requested URL
        Returns:
        true if this ViewPattern matches the given URL, and thus is a candidate for rendering
      • resolve

        public Map<String,​Stringresolve​(String path)
        Resolves a requested URL path. For each placeholder in the view pattern, the placeholder name and its value in the URL path is returned in a map.
        Parameters:
        path - the requested URL to be resolved
        Returns:
        Map containing the placeholder names and its values
      • evaluate

        public String evaluate​(org.springframework.expression.EvaluationContext context,
                               PathContext data)
        Evaluates the given EvaluationContext and builds an URL to the appropriate view.
        Parameters:
        context - EvaluationContext to be used
        data - PathContext containing all data required for building the URL
        Returns:
        URL that was built, or null if the PathContext did not contain all necessary data for building the URL