Polishing (backported from master)

(cherry picked from commit 92d78c1)
This commit is contained in:
Juergen Hoeller
2016-07-06 15:29:15 +02:00
parent 2e075baede
commit 0445ce6c53
54 changed files with 283 additions and 426 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,22 +23,23 @@ import org.springframework.http.HttpRequest;
/**
* Represents the context of a client-side HTTP request execution.
*
* <p>Used to invoke the next interceptor in the interceptor chain, or - if the calling interceptor is last - execute
* the request itself.
* <p>Used to invoke the next interceptor in the interceptor chain,
* or - if the calling interceptor is last - execute the request itself.
*
* @author Arjen Poutsma
* @see ClientHttpRequestInterceptor
* @since 3.1
* @see ClientHttpRequestInterceptor
*/
public interface ClientHttpRequestExecution {
/**
* Execute the request with the given request attributes and body, and return the response.
*
* Execute the request with the given request attributes and body,
* and return the response.
* @param request the request, containing method, URI, and headers
* @param body the body of the request to execute
* @return the response
* @throws IOException in case of I/O errors
*/
ClientHttpResponse execute(HttpRequest request, byte[] body) throws IOException;
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -279,8 +279,7 @@ public class Jackson2ObjectMapperBuilder {
/**
* Configure custom serializers. Each serializer is registered for the type
* returned by {@link JsonSerializer#handledType()}, which must not be
* {@code null}.
* returned by {@link JsonSerializer#handledType()}, which must not be {@code null}.
* @see #serializersByType(Map)
*/
public Jackson2ObjectMapperBuilder serializers(JsonSerializer<?>... serializers) {
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2009 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,9 +31,9 @@ import javax.xml.ws.WebServiceProvider;
* <p>Note that this exporter will only work if the JAX-WS runtime actually
* supports publishing with an address argument, i.e. if the JAX-WS runtime
* ships an internal HTTP server. This is the case with the JAX-WS runtime
* that's inclued in Sun's JDK 1.6 but not with the standalone JAX-WS 2.1 RI.
* that's included in Sun's JDK 6 but not with the standalone JAX-WS 2.1 RI.
*
* <p>For explicit configuration of JAX-WS endpoints with Sun's JDK 1.6
* <p>For explicit configuration of JAX-WS endpoints with Sun's JDK 6
* HTTP server, consider using {@link SimpleHttpServerJaxWsServiceExporter}!
*
* @author Juergen Hoeller
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2014 the original author or authors.
* Copyright 2002-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -70,6 +70,9 @@ import org.springframework.web.multipart.MultipartRequest;
*/
public class WebRequestDataBinder extends WebDataBinder {
private static final boolean servlet3Parts = ClassUtils.hasMethod(HttpServletRequest.class, "getParts");
/**
* Create a new WebRequestDataBinder instance, with default object name.
* @param target the target object to bind onto (or {@code null}
@@ -116,7 +119,7 @@ public class WebRequestDataBinder extends WebDataBinder {
if (multipartRequest != null) {
bindMultipart(multipartRequest.getMultiFileMap(), mpvs);
}
else if (ClassUtils.hasMethod(HttpServletRequest.class, "getParts")) {
else if (servlet3Parts) {
HttpServletRequest serlvetRequest = ((NativeWebRequest) request).getNativeRequest(HttpServletRequest.class);
new Servlet3MultipartHelper(isBindEmptyMultipartFiles()).bindParts(serlvetRequest, mpvs);
}