Polishing

This commit is contained in:
Juergen Hoeller
2018-11-22 17:44:29 +01:00
parent 5382260f30
commit e2b74e6943
17 changed files with 98 additions and 108 deletions

View File

@@ -962,9 +962,10 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
}
/**
* Return the value of the required {@code Host} header.
* <p>If the header value does not contain a port, the returned
* {@linkplain InetSocketAddress#getPort() port} will be {@code 0}.
* Return the value of the {@code Host} header, if available.
* <p>If the header value does not contain a port, the
* {@linkplain InetSocketAddress#getPort() port} in the returned address will
* be {@code 0}.
* @since 5.0
*/
@Nullable

View File

@@ -110,6 +110,7 @@ public class Jaxb2XmlDecoder extends AbstractDecoder<Object> {
@Override
public Mono<Object> decodeToMono(Publisher<DataBuffer> inputStream, ResolvableType elementType,
@Nullable MimeType mimeType, @Nullable Map<String, Object> hints) {
return decode(inputStream, elementType, mimeType, hints).singleOrEmpty();
}

View File

@@ -80,7 +80,7 @@ public interface ServerWebExchange {
@SuppressWarnings("unchecked")
default <T> T getRequiredAttribute(String name) {
T value = getAttribute(name);
Assert.notNull(value, () -> "Required attribute '" + name + "' is missing.");
Assert.notNull(value, () -> "Required attribute '" + name + "' is missing");
return value;
}
@@ -114,7 +114,6 @@ public interface ServerWebExchange {
/**
* Return the form data from the body of the request if the Content-Type is
* {@code "application/x-www-form-urlencoded"} or an empty map otherwise.
*
* <p><strong>Note:</strong> calling this method causes the request body to
* be read and parsed in full and the resulting {@code MultiValueMap} is
* cached so that this method is safe to call more than once.
@@ -124,7 +123,6 @@ public interface ServerWebExchange {
/**
* Return the parts of a multipart request if the Content-Type is
* {@code "multipart/form-data"} or an empty map otherwise.
*
* <p><strong>Note:</strong> calling this method causes the request body to
* be read and parsed in full and the resulting {@code MultiValueMap} is
* cached so that this method is safe to call more than once.
@@ -140,8 +138,7 @@ public interface ServerWebExchange {
/**
* Return the {@link ApplicationContext} associated with the web application,
* if it was initialized with one via
* {@link org.springframework.web.server.adapter.WebHttpHandlerBuilder#applicationContext
* WebHttpHandlerBuilder#applicationContext}.
* {@link org.springframework.web.server.adapter.WebHttpHandlerBuilder#applicationContext(ApplicationContext)}.
* @since 5.0.3
* @see org.springframework.web.server.adapter.WebHttpHandlerBuilder#applicationContext(ApplicationContext)
*/