Interface UrlFormat

    • Field Detail

      • OPENING_BRACKETS

        static final String OPENING_BRACKETS
        Deprecated.
        A CharSequence to be used to write defaults to the format when a mandatory parameter is missing.

        Consumers can check formatted urls on the existence of this CharSequence to identify urls that failed formatting.

        Example usage: parameters.getOrDefault(key, OPENING_BRACKETS + key + CLOSING_BRACKETS)

        See Also:
        Constant Field Values
      • CLOSING_BRACKETS

        static final String CLOSING_BRACKETS
        Deprecated.
        A CharSequence to be used to write defaults to the format when a mandatory parameter is missing.

        Consumers can check formatted urls on the existence of this CharSequence to identify urls that failed formatting.

        Example usage: parameters.getOrDefault(key, OPENING_BRACKETS + key + CLOSING_BRACKETS)

        See Also:
        Constant Field Values
    • Method Detail

      • format

        String format​(Map<String,​String> parameters)
        Deprecated.
        Formats an URL with the given parameters.
        Parameters:
        parameters - the URL parameters to be applied to the URL according to the internal format
        Returns:
        the formated URL
      • parse

        Map<String,​String> parse​(org.apache.sling.api.request.RequestPathInfo requestPathInfo,
                                       org.apache.sling.api.request.RequestParameterMap parameterMap)
        Deprecated.
        Parses a given request URI using the internal configured pattern.

        Returns a Map with up to all the parameter names returned by getParameterNames().

        Passing the returned Map of parameters into format(Map) must return the same pathInfo as used as input before.

        Parameters:
        requestPathInfo - the request path info object used to extra the URL information from
        parameterMap - the request parameters the implementation may consider when parsing the url
        Returns:
        a map containing the parsed URL elements
      • getParameterNames

        Set<String> getParameterNames()
        Deprecated.
        Returns a set of all parameter names the url format implementation supports when parsing a pathinfo.

        This may return more parameters, than the url format uses in format(Map).

        Returns:
        all supported parameter names.