Skip to content

Commit 5367ec0

Browse files
committed
Javadoc
1 parent d83b601 commit 5367ec0

File tree

4 files changed

+16
-12
lines changed

4 files changed

+16
-12
lines changed

org.springframework.web/src/main/java/org/springframework/http/MediaType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public MediaType(String type) {
7373
/**
7474
* Create a new {@link MediaType} for the given primary type and subtype.
7575
* <p>The parameters are empty.
76-
* @param typethe primary type
76+
* @param type the primary type
7777
* @param subtype the subtype
7878
*/
7979
public MediaType(String type, String subtype) {

org.springframework.web/src/main/java/org/springframework/web/client/DefaultResponseErrorHandler.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,15 @@
1818

1919
import java.io.IOException;
2020

21-
import org.springframework.web.client.HttpClientErrorException;
22-
import org.springframework.web.client.RestClientException;
23-
import org.springframework.web.client.HttpServerErrorException;
2421
import org.springframework.http.HttpStatus;
2522
import org.springframework.http.client.ClientHttpResponse;
2623

2724
/**
2825
* Default implementation of the {@link ResponseErrorHandler} interface.
2926
*
3027
* <p>This error handler checks for the status code on the {@link ClientHttpResponse}: any code with series
31-
* {@link HttpStatus.Series#CLIENT_ERROR} or {@link HttpStatus.Series#SERVER_ERROR} is considered to be an error.
28+
* {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR} or
29+
* {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR} is considered to be an error.
3230
* This behavior can be changed by overriding the {@link #hasError(HttpStatus)} method.
3331
*
3432
* @author Arjen Poutsma
@@ -46,18 +44,24 @@ public boolean hasError(ClientHttpResponse response) throws IOException {
4644

4745
/**
4846
* Template method called from {@link #hasError(ClientHttpResponse)}.
49-
* <p>The default implementation checks if the given status code is {@link HttpStatus.Series#CLIENT_ERROR}
50-
* or {@link HttpStatus.Series#SERVER_ERROR}. Can be overridden in subclasses.
47+
* <p>The default implementation checks if the given status code is
48+
* {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR CLIENT_ERROR}
49+
* or {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR SERVER_ERROR}. Can be overridden in subclasses.
5150
* @param statusCode the HTTP status code
5251
* @return <code>true</code> if the response has an error; <code>false</code> otherwise
53-
* @see HttpStatus.Series#CLIENT_ERROR
54-
* @see HttpStatus.Series#SERVER_ERROR
5552
*/
5653
protected boolean hasError(HttpStatus statusCode) {
5754
return (statusCode.series() == HttpStatus.Series.CLIENT_ERROR ||
5855
statusCode.series() == HttpStatus.Series.SERVER_ERROR);
5956
}
6057

58+
/**
59+
* {@inheritDoc}
60+
* <p>The default implementation throws a {@link HttpClientErrorException} if the response status code is
61+
* {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR}, a {@link HttpServerErrorException} if it is
62+
* {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR}, and a {@link RestClientException} in other
63+
* cases.
64+
*/
6165
public void handleError(ClientHttpResponse response) throws IOException {
6266
HttpStatus statusCode = response.getStatusCode();
6367
switch (statusCode.series()) {

org.springframework.web/src/main/java/org/springframework/web/client/RestTemplate.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
*
4646
* <p>The main entry points of this template are the methods named after the five main HTTP methods:
4747
* <table>
48-
* <tr><th>HTTP method<th><th>RestTemplate methods</th></tr>
48+
* <tr><th>HTTP method</th><th>RestTemplate methods</th></tr>
4949
* <tr><td>DELETE</td><td>{@link #delete}</td></tr>
5050
* <tr><td>GET</td><td>{@link #getForObject}</td></tr>
5151
* <tr><td>HEAD</td><td>{@link #headForHeaders}</td></tr>

org.springframework.web/src/main/java/org/springframework/web/client/support/RestGatewaySupport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
import org.apache.commons.logging.Log;
2020
import org.apache.commons.logging.LogFactory;
2121

22+
import org.springframework.http.client.ClientHttpRequestFactory;
2223
import org.springframework.util.Assert;
2324
import org.springframework.web.client.RestTemplate;
24-
import org.springframework.http.client.ClientHttpRequestFactory;
2525

2626
/**
2727
* Convenient super class for application classes that need REST access.
@@ -50,7 +50,7 @@ public RestGatewaySupport() {
5050

5151
/**
5252
* Construct a new instance of the {@link RestGatewaySupport}, with the given {@link ClientHttpRequestFactory}.
53-
* @see RestTemplate#RestTemplate(ClientHttpRequestFactory
53+
* @see RestTemplate#RestTemplate(ClientHttpRequestFactory)
5454
*/
5555
public RestGatewaySupport(ClientHttpRequestFactory requestFactory) {
5656
Assert.notNull(requestFactory, "'requestFactory' must not be null");

0 commit comments

Comments
 (0)