1
1
/*
2
- * Copyright 2002-2013 the original author or authors.
2
+ * Copyright 2002-2014 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
34
34
/**
35
35
* Builder for {@link UriComponents}.
36
36
*
37
- * <p></p> Typical usage involves:
37
+ * <p>Typical usage involves:
38
38
* <ol>
39
- * <li>Create a {@code UriComponentsBuilder} with one of the static factory methods (such as
40
- * {@link #fromPath(String)} or {@link #fromUri(URI)})</li>
41
- * <li>Set the various URI components through the respective methods ({@link #scheme(String)},
42
- * {@link #userInfo(String)}, {@link #host(String)}, {@link #port(int)}, {@link #path(String)},
43
- * {@link #pathSegment(String...)}, {@link #queryParam(String, Object...)}, and
44
- * {@link #fragment(String)}.</li>
45
- * <li>Build the {@link UriComponents} instance with the {@link #build()} method.</li>
39
+ * <li>Create a {@code UriComponentsBuilder} with one of the static factory methods
40
+ * (such as {@link #fromPath(String)} or {@link #fromUri(URI)})</li>
41
+ * <li>Set the various URI components through the respective methods ({@link #scheme(String)},
42
+ * {@link #userInfo(String)}, {@link #host(String)}, {@link #port(int)}, {@link #path(String)},
43
+ * {@link #pathSegment(String...)}, {@link #queryParam(String, Object...)}, and
44
+ * {@link #fragment(String)}.</li>
45
+ * <li>Build the {@link UriComponents} instance with the {@link #build()} method.</li>
46
46
* </ol>
47
47
*
48
48
* @author Arjen Poutsma
@@ -150,7 +150,7 @@ public static UriComponentsBuilder fromUri(URI uri) {
150
150
* contains {@code '='} or {@code '&'} characters, the query string cannot
151
151
* be parsed unambiguously. Such values should be substituted for URI
152
152
* variables to enable correct parsing:
153
- * <pre>
153
+ * <pre class="code" >
154
154
* String uriString = "/hotels/42?filter={value}";
155
155
* UriComponentsBuilder.fromUriString(uriString).buildAndExpand("hot&cold");
156
156
* </pre>
@@ -210,7 +210,7 @@ public static UriComponentsBuilder fromUriString(String uri) {
210
210
* contains {@code '='} or {@code '&'} characters, the query string cannot
211
211
* be parsed unambiguously. Such values should be substituted for URI
212
212
* variables to enable correct parsing:
213
- * <pre>
213
+ * <pre class="code" >
214
214
* String uriString = "/hotels/42?filter={value}";
215
215
* UriComponentsBuilder.fromUriString(uriString).buildAndExpand("hot&cold");
216
216
* </pre>
@@ -245,18 +245,18 @@ public static UriComponentsBuilder fromHttpUrl(String httpUrl) {
245
245
// build methods
246
246
247
247
/**
248
- * Builds a {@code UriComponents} instance from the various components contained in this builder.
248
+ * Build a {@code UriComponents} instance from the various components contained in this builder.
249
249
* @return the URI components
250
250
*/
251
251
public UriComponents build () {
252
252
return build (false );
253
253
}
254
254
255
255
/**
256
- * Builds a {@code UriComponents} instance from the various components
256
+ * Build a {@code UriComponents} instance from the various components
257
257
* contained in this builder.
258
258
* @param encoded whether all the components set in this builder are
259
- * encoded ({@code true}) or not ({@code false}).
259
+ * encoded ({@code true}) or not ({@code false}).
260
260
* @return the URI components
261
261
*/
262
262
public UriComponents build (boolean encoded ) {
@@ -270,8 +270,8 @@ public UriComponents build(boolean encoded) {
270
270
}
271
271
272
272
/**
273
- * Builds a {@code UriComponents} instance and replaces URI template variables
274
- * with the values from a map. This is a shortcut method, which combines
273
+ * Build a {@code UriComponents} instance and replaces URI template variables
274
+ * with the values from a map. This is a shortcut method which combines
275
275
* calls to {@link #build()} and then {@link UriComponents#expand(Map)}.
276
276
* @param uriVariables the map of URI variables
277
277
* @return the URI components with expanded values
@@ -281,8 +281,8 @@ public UriComponents buildAndExpand(Map<String, ?> uriVariables) {
281
281
}
282
282
283
283
/**
284
- * Builds a {@code UriComponents} instance and replaces URI template variables
285
- * with the values from an array. This is a shortcut method, which combines
284
+ * Build a {@code UriComponents} instance and replaces URI template variables
285
+ * with the values from an array. This is a shortcut method which combines
286
286
* calls to {@link #build()} and then {@link UriComponents#expand(Object...)}.
287
287
* @param uriVariableValues URI variable values
288
288
* @return the URI components with expanded values
@@ -295,7 +295,7 @@ public UriComponents buildAndExpand(Object... uriVariableValues) {
295
295
// URI components methods
296
296
297
297
/**
298
- * Initializes all components of this URI builder with the components of the given URI.
298
+ * Initialize all components of this URI builder with the components of the given URI.
299
299
* @param uri the URI
300
300
* @return this UriComponentsBuilder
301
301
*/
@@ -344,7 +344,7 @@ private void resetSchemeSpecificPart() {
344
344
}
345
345
346
346
/**
347
- * Sets the URI scheme. The given scheme may contain URI template variables,
347
+ * Set the URI scheme. The given scheme may contain URI template variables,
348
348
* and may also be {@code null} to clear the scheme of this builder.
349
349
* @param scheme the URI scheme
350
350
* @return this UriComponentsBuilder
@@ -369,9 +369,8 @@ public UriComponentsBuilder schemeSpecificPart(String ssp) {
369
369
}
370
370
371
371
/**
372
- * Sets the URI user info. The given user info may contain URI template
373
- * variables, and may also be {@code null} to clear the user info of this
374
- * builder.
372
+ * Set the URI user info. The given user info may contain URI template variables,
373
+ * and may also be {@code null} to clear the user info of this builder.
375
374
* @param userInfo the URI user info
376
375
* @return this UriComponentsBuilder
377
376
*/
@@ -382,8 +381,8 @@ public UriComponentsBuilder userInfo(String userInfo) {
382
381
}
383
382
384
383
/**
385
- * Sets the URI host. The given host may contain URI template variables, and
386
- * may also be {@code null} to clear the host of this builder.
384
+ * Set the URI host. The given host may contain URI template variables,
385
+ * and may also be {@code null} to clear the host of this builder.
387
386
* @param host the URI host
388
387
* @return this UriComponentsBuilder
389
388
*/
@@ -394,7 +393,7 @@ public UriComponentsBuilder host(String host) {
394
393
}
395
394
396
395
/**
397
- * Sets the URI port. Passing {@code -1} will clear the port of this builder.
396
+ * Set the URI port. Passing {@code -1} will clear the port of this builder.
398
397
* @param port the URI port
399
398
* @return this UriComponentsBuilder
400
399
*/
@@ -406,8 +405,8 @@ public UriComponentsBuilder port(int port) {
406
405
}
407
406
408
407
/**
409
- * Appends the given path to the existing path of this builder. The given
410
- * path may contain URI template variables.
408
+ * Append the given path to the existing path of this builder.
409
+ * The given path may contain URI template variables.
411
410
* @param path the URI path
412
411
* @return this UriComponentsBuilder
413
412
*/
@@ -418,7 +417,7 @@ public UriComponentsBuilder path(String path) {
418
417
}
419
418
420
419
/**
421
- * Sets the path of this builder overriding all existing path and path segment values.
420
+ * Set the path of this builder overriding all existing path and path segment values.
422
421
* @param path the URI path; a {@code null} value results in an empty path.
423
422
* @return this UriComponentsBuilder
424
423
*/
@@ -429,8 +428,8 @@ public UriComponentsBuilder replacePath(String path) {
429
428
}
430
429
431
430
/**
432
- * Appends the given path segments to the existing path of this builder. Each given
433
- * path segments may contain URI template variables.
431
+ * Append the given path segments to the existing path of this builder.
432
+ * Each given path segment may contain URI template variables.
434
433
* @param pathSegments the URI path segments
435
434
* @return this UriComponentsBuilder
436
435
*/
@@ -442,14 +441,14 @@ public UriComponentsBuilder pathSegment(String... pathSegments) throws IllegalAr
442
441
}
443
442
444
443
/**
445
- * Appends the given query to the existing query of this builder.
444
+ * Append the given query to the existing query of this builder.
446
445
* The given query may contain URI template variables.
447
446
* <p><strong>Note:</strong> The presence of reserved characters can prevent
448
447
* correct parsing of the URI string. For example if a query parameter
449
448
* contains {@code '='} or {@code '&'} characters, the query string cannot
450
449
* be parsed unambiguously. Such values should be substituted for URI
451
450
* variables to enable correct parsing:
452
- * <pre>
451
+ * <pre class="code" >
453
452
* String uriString = "/hotels/42?filter={value}";
454
453
* UriComponentsBuilder.fromUriString(uriString).buildAndExpand("hot&cold");
455
454
* </pre>
@@ -475,7 +474,7 @@ public UriComponentsBuilder query(String query) {
475
474
}
476
475
477
476
/**
478
- * Sets the query of this builder overriding all existing query parameters.
477
+ * Set the query of this builder overriding all existing query parameters.
479
478
* @param query the query string; a {@code null} value removes all query parameters.
480
479
* @return this UriComponentsBuilder
481
480
*/
@@ -487,7 +486,7 @@ public UriComponentsBuilder replaceQuery(String query) {
487
486
}
488
487
489
488
/**
490
- * Appends the given query parameter to the existing query parameters. The
489
+ * Append the given query parameter to the existing query parameters. The
491
490
* given name or any of the values may contain URI template variables. If no
492
491
* values are given, the resulting URI will contain the query parameter name
493
492
* only (i.e. {@code ?foo} instead of {@code ?foo=bar}.
@@ -511,9 +510,8 @@ public UriComponentsBuilder queryParam(String name, Object... values) {
511
510
}
512
511
513
512
/**
514
- * Sets the query parameter values overriding all existing query values for
515
- * the same parameter. If no values are given, the query parameter is
516
- * removed.
513
+ * Set the query parameter values overriding all existing query values for
514
+ * the same parameter. If no values are given, the query parameter is removed.
517
515
* @param name the query parameter name
518
516
* @param values the query parameter values
519
517
* @return this UriComponentsBuilder
@@ -529,9 +527,8 @@ public UriComponentsBuilder replaceQueryParam(String name, Object... values) {
529
527
}
530
528
531
529
/**
532
- * Sets the URI fragment. The given fragment may contain URI template
533
- * variables, and may also be {@code null} to clear the fragment of this
534
- * builder.
530
+ * Set the URI fragment. The given fragment may contain URI template variables,
531
+ * and may also be {@code null} to clear the fragment of this builder.
535
532
* @param fragment the URI fragment
536
533
* @return this UriComponentsBuilder
537
534
*/
0 commit comments