Sonar Fixes - Javadoc-only imports

This commit is contained in:
Gary Russell
2019-01-02 12:26:22 -05:00
committed by Artem Bilan
parent a39881fd0d
commit e8df546b04
184 changed files with 820 additions and 805 deletions

View File

@@ -24,10 +24,10 @@ import java.lang.annotation.Target;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.AliasFor;
import org.springframework.integration.http.management.IntegrationGraphController;
/**
* Enables the {@link IntegrationGraphController} if
* Enables the
* {@link org.springframework.integration.http.management.IntegrationGraphController} if
* {@code org.springframework.web.servlet.DispatcherServlet} or
* {@code org.springframework.web.reactive.DispatcherHandler} is present in the classpath.
*
@@ -35,7 +35,7 @@ import org.springframework.integration.http.management.IntegrationGraphControlle
*
* @since 4.3
*
* @see IntegrationGraphController
* @see org.springframework.integration.http.management.IntegrationGraphController
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@@ -44,17 +44,21 @@ import org.springframework.integration.http.management.IntegrationGraphControlle
public @interface EnableIntegrationGraphController {
/**
* Specify the Request Mapping path for the {@link IntegrationGraphController}.
* Specify the Request Mapping path for the
* {@link org.springframework.integration.http.management.IntegrationGraphController}.
* Defaults to {@value HttpContextUtils#GRAPH_CONTROLLER_DEFAULT_PATH}.
* @return The Request Mapping path for the {@link IntegrationGraphController}
* @return The Request Mapping path for the
* {@link org.springframework.integration.http.management.IntegrationGraphController}
*/
@AliasFor("path")
String value() default HttpContextUtils.GRAPH_CONTROLLER_DEFAULT_PATH;
/**
* Specify the Request Mapping path for the {@link IntegrationGraphController}.
* Specify the Request Mapping path for the
* {@link org.springframework.integration.http.management.IntegrationGraphController}.
* Defaults to {@value HttpContextUtils#GRAPH_CONTROLLER_DEFAULT_PATH}.
* @return The Request Mapping path for the {@link IntegrationGraphController}
* @return The Request Mapping path for the
* {@link org.springframework.integration.http.management.IntegrationGraphController}
*/
@AliasFor("value")
String path() default HttpContextUtils.GRAPH_CONTROLLER_DEFAULT_PATH;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2018 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.
@@ -26,11 +26,11 @@ import org.springframework.http.HttpInputMessage;
import org.springframework.http.HttpOutputMessage;
import org.springframework.http.MediaType;
import org.springframework.http.converter.AbstractHttpMessageConverter;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.util.FileCopyUtils;
/**
* An {@link HttpMessageConverter} implementation for {@link Serializable} instances.
* An {@link org.springframework.http.converter.HttpMessageConverter} implementation for
* {@link Serializable} instances.
*
* @author Mark Fisher
* @author Gary Russell

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016-2017 the original author or authors.
* Copyright 2016-2018 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.
@@ -19,17 +19,18 @@ package org.springframework.integration.http.dsl;
import java.util.Arrays;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.integration.dsl.MessagingGatewaySpec;
import org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport;
import org.springframework.web.multipart.MultipartResolver;
/**
* A base {@link MessagingGatewaySpec} for the {@link HttpRequestHandlingEndpointSupport} implementations.
* A base {@link org.springframework.integration.dsl.MessagingGatewaySpec} for the
* {@link HttpRequestHandlingEndpointSupport} implementations.
*
* @param <S> the target {@link BaseHttpInboundEndpointSpec} implementation type.
* @param <E> the target {@link HttpRequestHandlingEndpointSupport} implementation type.
*
* @author Artem Bilan
* @author Gary Russell
*
* @since 5.0
*/

View File

@@ -28,13 +28,11 @@ import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.RequestEntity;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.integration.dsl.ComponentsRegistration;
import org.springframework.integration.dsl.MessagingGatewaySpec;
import org.springframework.integration.expression.FunctionExpression;
import org.springframework.integration.http.inbound.BaseHttpInboundEndpoint;
import org.springframework.integration.http.inbound.CrossOrigin;
import org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport;
import org.springframework.integration.http.inbound.RequestMapping;
import org.springframework.integration.http.support.DefaultHttpHeaderMapper;
import org.springframework.integration.mapping.HeaderMapper;
@@ -43,6 +41,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
/**
* @author Artem Bilan
* @author Gary Russell
*
* @since 5.0
*/
@@ -94,7 +93,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
* Specify a SpEL expression to evaluate in order to generate the Message payload.
* @param payloadExpression The payload expression.
* @return the spec
* @see HttpRequestHandlingEndpointSupport#setPayloadExpression(Expression)
* @see org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport#setPayloadExpression(Expression)
*/
public S payloadExpression(String payloadExpression) {
return payloadExpression(PARSER.parseExpression(payloadExpression));
@@ -104,7 +103,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
* Specify a SpEL expression to evaluate in order to generate the Message payload.
* @param payloadExpression The payload expression.
* @return the spec
* @see HttpRequestHandlingEndpointSupport#setPayloadExpression(Expression)
* @see org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport#setPayloadExpression(Expression)
*/
public S payloadExpression(Expression payloadExpression) {
this.target.setPayloadExpression(payloadExpression);
@@ -116,7 +115,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
* @param payloadFunction The payload {@link Function}.
* @param <P> the expected HTTP request body type.
* @return the spec
* @see HttpRequestHandlingEndpointSupport#setPayloadExpression(Expression)
* @see org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport#setPayloadExpression(Expression)
*/
public <P> S payloadFunction(Function<HttpEntity<P>, ?> payloadFunction) {
return payloadExpression(new FunctionExpression<>(payloadFunction));
@@ -126,7 +125,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
* Specify a Map of SpEL expressions to evaluate in order to generate the Message headers.
* @param headerExpressions The {@link Map} of SpEL expressions for headers.
* @return the spec
* @see HttpRequestHandlingEndpointSupport#setHeaderExpressions(Map)
* @see org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport#setHeaderExpressions(Map)
*/
public S headerExpressions(Map<String, Expression> headerExpressions) {
Assert.notNull(headerExpressions, "'headerExpressions' must not be null");
@@ -140,7 +139,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
* @param header the header name to populate.
* @param expression the SpEL expression for the header.
* @return the spec
* @see HttpRequestHandlingEndpointSupport#setHeaderExpressions(Map)
* @see org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport#setHeaderExpressions(Map)
*/
public S headerExpression(String header, String expression) {
return headerExpression(header, PARSER.parseExpression(expression));
@@ -151,7 +150,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
* @param header the header name to populate.
* @param expression the SpEL expression for the header.
* @return the spec
* @see HttpRequestHandlingEndpointSupport#setHeaderExpressions(Map)
* @see org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport#setHeaderExpressions(Map)
*/
public S headerExpression(String header, Expression expression) {
this.headerExpressions.put(header, expression);
@@ -164,7 +163,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
* @param headerFunction the function to evaluate the header value against {@link HttpEntity}.
* @param <P> the expected HTTP body type.
* @return the current Spec.
* @see HttpRequestHandlingEndpointSupport#setHeaderExpressions(Map)
* @see org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport#setHeaderExpressions(Map)
*/
public <P> S headerFunction(String header, Function<HttpEntity<P>, ?> headerFunction) {
return headerExpression(header, new FunctionExpression<>(headerFunction));
@@ -211,7 +210,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
/**
* Specify the type of payload to be generated when the inbound HTTP request content is read by the
* {@link HttpMessageConverter}s.
* {@link org.springframework.http.converter.HttpMessageConverter}s.
* By default this value is null which means at runtime any "text" Content-Type will
* result in String while all others default to <code>byte[].class</code>.
* @param requestPayloadType The payload type.
@@ -224,7 +223,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
/**
* Specify the type of payload to be generated when the inbound HTTP request content is read by the
* {@link HttpMessageConverter}s.
* {@link org.springframework.http.converter.HttpMessageConverter}s.
* By default this value is null which means at runtime any "text" Content-Type will
* result in String while all others default to <code>byte[].class</code>.
* @param requestPayloadType The payload type.
@@ -252,7 +251,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
* the default '200 OK' or '500 Internal Server Error' for a timeout.
* @param statusCodeExpression The status code Expression.
* @return the current Spec.
* @see HttpRequestHandlingEndpointSupport#setStatusCodeExpression(Expression)
* @see org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport#setStatusCodeExpression(Expression)
*/
public S statusCodeExpression(String statusCodeExpression) {
this.target.setStatusCodeExpressionString(statusCodeExpression);
@@ -264,7 +263,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
* the default '200 OK' or '500 Internal Server Error' for a timeout.
* @param statusCodeExpression The status code Expression.
* @return the current Spec.
* @see HttpRequestHandlingEndpointSupport#setStatusCodeExpression(Expression)
* @see org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport#setStatusCodeExpression(Expression)
*/
public S statusCodeExpression(Expression statusCodeExpression) {
this.target.setStatusCodeExpression(statusCodeExpression);
@@ -276,7 +275,7 @@ public abstract class HttpInboundEndpointSupportSpec<S extends HttpInboundEndpoi
* the default '200 OK' or '500 Internal Server Error' for a timeout.
* @param statusCodeFunction The status code {@link Function}.
* @return the current Spec.
* @see HttpRequestHandlingEndpointSupport#setStatusCodeExpression(Expression)
* @see org.springframework.integration.http.inbound.HttpRequestHandlingEndpointSupport#setStatusCodeExpression(Expression)
*/
public S statusCodeFunction(Function<RequestEntity<?>, ?> statusCodeFunction) {
return statusCodeExpression(new FunctionExpression<>(statusCodeFunction));

View File

@@ -35,7 +35,6 @@ import org.springframework.integration.expression.ExpressionUtils;
import org.springframework.integration.gateway.MessagingGatewaySupport;
import org.springframework.integration.http.support.DefaultHttpHeaderMapper;
import org.springframework.integration.mapping.HeaderMapper;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
@@ -241,7 +240,7 @@ public class BaseHttpInboundEndpoint extends MessagingGatewaySupport implements
* {@link #BaseHttpInboundEndpoint(boolean) expectReply} is true) resolves
* an {@link HttpStatus} from the
* {@link org.springframework.integration.http.HttpHeaders#STATUS_CODE} reply
* {@link Message} header.
* {@link org.springframework.messaging.Message} header.
* @param statusCodeExpression The status code Expression.
* @since 4.1
* @see #setReplyTimeout(long)

View File

@@ -23,7 +23,6 @@ import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.context.MessageSource;
import org.springframework.expression.Expression;
import org.springframework.expression.common.LiteralExpression;
import org.springframework.expression.spel.support.StandardEvaluationContext;
@@ -33,7 +32,6 @@ import org.springframework.http.server.ServletServerHttpResponse;
import org.springframework.messaging.Message;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import org.springframework.validation.Errors;
import org.springframework.validation.MapBindingResult;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.View;
@@ -112,8 +110,8 @@ public class HttpRequestHandlingController extends HttpRequestHandlingEndpointSu
}
/**
* The key used to expose {@link Errors} in the core, in the case that message handling fails. Defaults to
* "errors".
* The key used to expose {@link org.springframework.validation.Errors} in the core,
* in the case that message handling fails. Defaults to "errors".
* @param errorsKey The key value to set.
*/
public void setErrorsKey(String errorsKey) {
@@ -122,7 +120,8 @@ public class HttpRequestHandlingController extends HttpRequestHandlingEndpointSu
/**
* The error code to use to signal an error in the message handling. In the case of an error this code will be
* provided in an object error to be optionally translated in the standard MVC way using a {@link MessageSource}.
* provided in an object error to be optionally translated in the standard MVC way using a
* {@link org.springframework.context.MessageSource}.
* The default value is <code>spring.integration.http.handler.error</code>. Three arguments are provided: the
* exception, its message and its stack trace as a String.
* @param errorCode The error code to set.

View File

@@ -53,7 +53,6 @@ import org.springframework.http.server.ServletServerHttpResponse;
import org.springframework.integration.MessageTimeoutException;
import org.springframework.integration.http.converter.MultipartAwareFormHttpMessageConverter;
import org.springframework.integration.http.multipart.MultipartHttpInputMessage;
import org.springframework.integration.mapping.HeaderMapper;
import org.springframework.integration.support.AbstractIntegrationMessageBuilder;
import org.springframework.integration.support.json.JacksonPresent;
import org.springframework.messaging.Message;
@@ -81,8 +80,8 @@ import org.springframework.web.servlet.HandlerMapping;
* {@link #setMessageConverters(List)}.
* <p>
* To customize the mapping of request headers to the MessageHeaders, provide a
* reference to a {@code HeaderMapper<HttpHeaders>} implementation
* to the {@link #setHeaderMapper(HeaderMapper)} method.
* reference to a {@code org.springframework.integration.mapping.HeaderMapper<HttpHeaders>} implementation
* to the {@link #setHeaderMapper(org.springframework.integration.mapping.HeaderMapper)} method.
* <p>
* The behavior is "request/reply" by default. Pass {@code false} to the constructor
* to force send-only as opposed to sendAndReceive. Send-only means that as soon as

View File

@@ -31,11 +31,9 @@ import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.server.ServletServerHttpRequest;
import org.springframework.http.server.ServletServerHttpResponse;
import org.springframework.integration.http.converter.MultipartAwareFormHttpMessageConverter;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessagingException;
import org.springframework.util.CollectionUtils;
import org.springframework.util.MultiValueMap;
import org.springframework.web.HttpRequestHandler;
/**
@@ -47,11 +45,14 @@ import org.springframework.web.HttpRequestHandler;
* <p>
* The default supported request methods are GET and POST, but the list of values can be configured with the
* {@link RequestMapping#methods} property. The payload generated from a GET request (or HEAD or OPTIONS if supported) will
* be a {@link MultiValueMap} containing the parameter values. For a request containing a body (e.g. a POST), the type
* be a {@link org.springframework.util.MultiValueMap} containing the parameter values. For a request containing a body
* (e.g. a POST), the type
* of the payload is determined by the {@link #setRequestPayloadTypeClass(Class)} request payload type}.
* <p>
* If the HTTP request is a multipart and a "multipartResolver" bean has been defined in the context, then it will be
* converted by the {@link MultipartAwareFormHttpMessageConverter} as long as the default message converters have not
* converted by the
* {@link org.springframework.integration.http.converter.MultipartAwareFormHttpMessageConverter} as long as the default
* message converters have not
* been overwritten (although providing a customized instance of the Multipart-aware converter is also an option).
* <p>
* By default a number of {@link HttpMessageConverter}s are already configured. The list can be overridden by calling
@@ -60,6 +61,7 @@ import org.springframework.web.HttpRequestHandler;
* @author Mark Fisher
* @author Oleg Zhurakousky
* @author Artem Bilan
* @author Gary Russell
*
* @since 2.0
*/
@@ -93,6 +95,7 @@ public class HttpRequestHandlingMessagingGateway extends HttpRequestHandlingEndp
* 'expectReply' property is true, it will also generate a response from the reply Message once received. That
* response will be written by the {@link HttpMessageConverter}s.
*/
@Override
public final void handleRequest(HttpServletRequest servletRequest, HttpServletResponse servletResponse)
throws IOException {

View File

@@ -56,7 +56,6 @@ import org.springframework.util.CollectionUtils;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponents;
import org.springframework.web.util.UriComponentsBuilder;
@@ -115,10 +114,10 @@ public abstract class AbstractHttpRequestExecutingMessageHandler extends Abstrac
/**
* Specify whether the real URI should be encoded after <code>uriVariables</code>
* expanding and before send request via {@link RestTemplate}. The default value is <code>true</code>.
*
* expanding and before send request via
* {@link org.springframework.web.client.RestTemplate}. The default value is
* <code>true</code>.
* @param encodeUri true if the URI should be encoded.
*
* @see UriComponentsBuilder
*/
public void setEncodeUri(boolean encodeUri) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -20,20 +20,16 @@ import java.net.URI;
import java.util.List;
import java.util.function.Supplier;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.expression.Expression;
import org.springframework.expression.common.LiteralExpression;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.integration.expression.ValueExpression;
import org.springframework.integration.mapping.HeaderMapper;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHandler;
import org.springframework.messaging.MessageHandlingException;
import org.springframework.util.Assert;
import org.springframework.web.client.ResponseErrorHandler;
@@ -41,14 +37,18 @@ import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;
/**
* A {@link MessageHandler} implementation that executes HTTP requests by delegating
* A {@link org.springframework.messaging.MessageHandler}
* implementation that executes HTTP requests by delegating
* to a {@link RestTemplate} instance. If the 'expectReply' flag is set to true (the default)
* then a reply Message will be generated from the HTTP response. If that response contains
* a body, it will be used as the reply Message's payload. Otherwise the reply Message's
* payload will contain the response status as an instance of the {@link HttpStatus} enum.
* When there is a response body, the {@link HttpStatus} enum instance will instead be
* payload will contain the response status as an instance of the
* {@link org.springframework.http.HttpStatus} enum.
* When there is a response body, the {@link org.springframework.http.HttpStatus} enum
* instance will instead be
* copied to the MessageHeaders of the reply. In both cases, the response headers will
* be mapped to the reply Message's headers by this handler's {@link HeaderMapper} instance.
* be mapped to the reply Message's headers by this handler's
* {@link org.springframework.integration.mapping.HeaderMapper} instance.
*
* @author Mark Fisher
* @author Oleg Zhurakousky
@@ -108,7 +108,7 @@ public class HttpRequestExecutingMessageHandler extends AbstractHttpRequestExecu
/**
* Create a handler that will send requests to the provided URI using a provided RestTemplate
* @param uriExpression A SpEL Expression that can be resolved against the message object and
* {@link BeanFactory}.
* {@link org.springframework.beans.factory.BeanFactory}.
* @param restTemplate The rest template.
*/
public HttpRequestExecutingMessageHandler(Expression uriExpression, RestTemplate restTemplate) {