类 DefaultUriTemplateHandler

    • 方法详细资料

      • setParsePath

        public void setParsePath​(boolean parsePath)
        Whether to parse the path of a URI template string into path segments.

        If set to true the URI template path is immediately decomposed into path segments any URI variables expanded into it are then subject to path segment encoding rules. In effect URI variables in the path have any "/" characters percent encoded.

        By default this is set to false in which case the path is kept as a full path and expanded URI variables will preserve "/" characters.

        参数:
        parsePath - whether to parse the path into path segments
      • shouldParsePath

        public boolean shouldParsePath()
        Whether the handler is configured to parse the path into path segments.
      • setStrictEncoding

        public void setStrictEncoding​(boolean strictEncoding)
        Whether to encode characters outside the unreserved set as defined in RFC 3986 Section 2. This ensures a URI variable value will not contain any characters with a reserved purpose.

        By default this is set to false in which case only characters illegal for the given URI component are encoded. For example when expanding a URI variable into a path segment the "/" character is illegal and encoded. The ";" character however is legal and not encoded even though it has a reserved purpose.

        Note: this property supersedes the need to also set the parsePath property.

        参数:
        strictEncoding - whether to perform strict encoding
        从以下版本开始:
        4.3
      • isStrictEncoding

        public boolean isStrictEncoding()
        Whether to strictly encode any character outside the unreserved set.