Browse Source

UriComponentsBuilder Javadoc update

Closes gh-25604
5.0.x
Rossen Stoyanchev 5 years ago
parent
commit
ca6ac8e310
  1. 18
      spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java

18
spring-web/src/main/java/org/springframework/web/util/UriComponentsBuilder.java

@ -182,7 +182,13 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable { @@ -182,7 +182,13 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable {
}
/**
* Create a builder that is initialized with the given {@code URI}.
* Create a builder that is initialized from the given {@code URI}.
* <p><strong>Note:</strong> the components in the resulting builder will be
* in fully encoded (raw) form and further changes must also supply values
* that are fully encoded, for example via methods in {@link UriUtils}.
* In addition please use {@link #build(boolean)} with a value of "true" to
* build the {@link UriComponents} instance in order to indicate that the
* components are encoded.
* @param uri the URI to initialize with
* @return the new {@code UriComponentsBuilder}
*/
@ -379,11 +385,13 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable { @@ -379,11 +385,13 @@ public class UriComponentsBuilder implements UriBuilder, Cloneable {
}
/**
* Build a {@code UriComponents} instance from the various components
* contained in this builder.
* @param encoded whether all the components set in this builder are
* encoded ({@code true}) or not ({@code false})
* Variant of {@link #build()} to create a {@link UriComponents} instance
* when components are already fully encoded. This is useful for example if
* the builder was created via {@link UriComponentsBuilder#fromUri(URI)}.
* @param encoded whether the components in this builder are already encoded
* @return the URI components
* @throws IllegalArgumentException if any of the components contain illegal
* characters that should have been encoded.
*/
public UriComponents build(boolean encoded) {
return buildInternal(encoded ?

Loading…
Cancel
Save