org.springframework.web.util

Class DefaultUriBuilderFactory

  • java.lang.Object
    • org.springframework.web.util.DefaultUriBuilderFactory
    • Method Detail

      • setDefaultUriVariables

        public void setDefaultUriVariables(@Nullable
                                           java.util.Map<java.lang.String,?> defaultUriVariables)
        Provide default URI variable values to use when expanding URI templates with a Map of variables.
        Parameters:
        defaultUriVariables - default URI variable values
      • getDefaultUriVariables

        public java.util.Map<java.lang.String,?> getDefaultUriVariables()
        Return the configured default URI variable values.
      • setParsePath

        public void setParsePath(boolean parsePath)
        Whether to parse the input path into path segments if the encoding mode is set to EncodingMode.URI_COMPONENT, which ensures that URI variables in the path are encoded according to path segment rules and for example a '/' is encoded.

        By default this is set to true.

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

        public boolean shouldParsePath()
        Whether to parse the path into path segments if the encoding mode is set to EncodingMode.URI_COMPONENT.
      • expand

        public java.net.URI expand(java.lang.String uriTemplate,
                                   java.util.Map<java.lang.String,?> uriVars)
        Description copied from interface: UriTemplateHandler
        Expand the given URI template with a map of URI variables.
        Specified by:
        expand in interface UriTemplateHandler
        Parameters:
        uriTemplate - the URI template
        uriVars - variable values
        Returns:
        the created URI instance
      • expand

        public java.net.URI expand(java.lang.String uriTemplate,
                                   java.lang.Object... uriVars)
        Description copied from interface: UriTemplateHandler
        Expand the given URI template with an array of URI variables.
        Specified by:
        expand in interface UriTemplateHandler
        Parameters:
        uriTemplate - the URI template
        uriVars - variable values
        Returns:
        the created URI instance
      • uriString

        public UriBuilder uriString(java.lang.String uriTemplate)
        Description copied from interface: UriBuilderFactory
        Initialize a builder with the given URI template.
        Specified by:
        uriString in interface UriBuilderFactory
        Parameters:
        uriTemplate - the URI template to use
        Returns:
        the URI builder instance