org.springframework.web.util

## Class DefaultUriTemplateHandler

- java.lang.Object
- - org.springframework.web.util.AbstractUriTemplateHandler
  - - org.springframework.web.util.DefaultUriTemplateHandler

- All Implemented Interfaces:
    UriTemplateHandler

  Deprecated.
  as of 5.0 in favor of `DefaultUriBuilderFactory`.

  Note: `DefaultUriBuilderFactory` has a different default for the `parsePath` property (from false to true).

      @Deprecated
      public class DefaultUriTemplateHandler
      extends AbstractUriTemplateHandler

  Default implementation of `UriTemplateHandler` based on the use of `UriComponentsBuilder` for expanding and encoding variables.

  There are also several properties to customize how URI template handling is performed, including a `baseUrl` to be used as a prefix for all URI templates and a couple of encoding related options — `parsePath` and `strictEncoding` respectively.

  Since:
    4.2
  Author:
    Rossen Stoyanchev

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultUriTemplateHandler()` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected UriComponents` | `expandAndEncode(UriComponentsBuilder builder, Map<String,?> uriVariables)` Deprecated.
    `protected UriComponents` | `expandAndEncode(UriComponentsBuilder builder, Object[] uriVariables)` Deprecated.
    `protected URI` | `expandInternal(String uriTemplate, Map<String,?> uriVariables)` Deprecated. Actually expand and encode the URI template.
    `protected URI` | `expandInternal(String uriTemplate, Object... uriVariables)` Deprecated. Actually expand and encode the URI template.
    `protected UriComponentsBuilder` | `initUriComponentsBuilder(String uriTemplate)` Deprecated. Create a `UriComponentsBuilder` from the URI template string.
    `boolean` | `isStrictEncoding()` Deprecated. Whether to strictly encode any character outside the unreserved set.
    `void` | `setParsePath(boolean parsePath)` Deprecated. Whether to parse the path of a URI template string into path segments.
    `void` | `setStrictEncoding(boolean strictEncoding)` Deprecated. Whether to encode characters outside the unreserved set as defined in RFC 3986 Section 2.
    `boolean` | `shouldParsePath()` Deprecated. Whether the handler is configured to parse the path into path segments.

    - ### Methods inherited from class org.springframework.web.util.AbstractUriTemplateHandler

      `expand, expand, getBaseUrl, getDefaultUriVariables, setBaseUrl, setDefaultUriVariables`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultUriTemplateHandler

          public DefaultUriTemplateHandler()

      Deprecated.

  - ### Method Detail

    - #### setParsePath

          public void setParsePath(boolean parsePath)

      Deprecated.
      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.

      Parameters:
        `parsePath` - whether to parse the path into path segments

    - #### shouldParsePath

          public boolean shouldParsePath()

      Deprecated.
      Whether the handler is configured to parse the path into path segments.

    - #### setStrictEncoding

          public void setStrictEncoding(boolean strictEncoding)

      Deprecated.
      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.

      Parameters:
        `strictEncoding` - whether to perform strict encoding
      Since:
        4.3

    - #### isStrictEncoding

          public boolean isStrictEncoding()

      Deprecated.
      Whether to strictly encode any character outside the unreserved set.

    - #### expandInternal

          protected URI expandInternal(String uriTemplate,
                                       Map<String,?> uriVariables)

      Deprecated.
      Description copied from class: `AbstractUriTemplateHandler`
      Actually expand and encode the URI template.
      Specified by:
        `expandInternal` in class `AbstractUriTemplateHandler`

    - #### expandInternal

          protected URI expandInternal(String uriTemplate,
                                       Object... uriVariables)

      Deprecated.
      Description copied from class: `AbstractUriTemplateHandler`
      Actually expand and encode the URI template.
      Specified by:
        `expandInternal` in class `AbstractUriTemplateHandler`

    - #### initUriComponentsBuilder

          protected UriComponentsBuilder initUriComponentsBuilder(String uriTemplate)

      Deprecated.
      Create a `UriComponentsBuilder` from the URI template string. This implementation also breaks up the path into path segments depending on whether `parsePath` is enabled.

    - #### expandAndEncode

          protected UriComponents expandAndEncode(UriComponentsBuilder builder,
                                                  Map<String,?> uriVariables)

      Deprecated.

    - #### expandAndEncode

          protected UriComponents expandAndEncode(UriComponentsBuilder builder,
                                                  Object[] uriVariables)

      Deprecated.