Moved WebExchangeDataBinder to web.bind.support (alongside WebRequestDataBinder)
Issue: SPR-14542
This commit is contained in:
@@ -13,7 +13,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.web.bind;
|
||||
|
||||
package org.springframework.web.bind.support;
|
||||
|
||||
import java.beans.PropertyEditor;
|
||||
import java.util.List;
|
||||
@@ -13,7 +13,8 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.web.bind;
|
||||
|
||||
package org.springframework.web.bind.support;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
@@ -27,6 +28,7 @@ import org.springframework.beans.MutablePropertyValues;
|
||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.bind.WebDataBinder;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
|
||||
@@ -39,7 +41,6 @@ import org.springframework.web.server.ServerWebExchange;
|
||||
*/
|
||||
public class WebExchangeDataBinder extends WebDataBinder {
|
||||
|
||||
|
||||
/**
|
||||
* Create a new instance, with default object name.
|
||||
* @param target the target object to bind onto (or {@code null} if the
|
||||
@@ -65,12 +66,10 @@ public class WebExchangeDataBinder extends WebDataBinder {
|
||||
* Bind the URL query parameters or form data of the body of the given request
|
||||
* to this binder's target. The request body is parsed if the content-type
|
||||
* is "application/x-www-form-urlencoded".
|
||||
*
|
||||
* @param exchange the current exchange.
|
||||
* @return a {@code Mono<Void>} to indicate the result
|
||||
*/
|
||||
public Mono<Void> bind(ServerWebExchange exchange) {
|
||||
|
||||
ServerHttpRequest request = exchange.getRequest();
|
||||
Mono<MultiValueMap<String, String>> queryParams = Mono.just(request.getQueryParams());
|
||||
Mono<MultiValueMap<String, String>> formParams =
|
||||
@@ -136,4 +135,4 @@ public class WebExchangeDataBinder extends WebDataBinder {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -13,12 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.http.codec;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.Collections;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.Test;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.test.StepVerifier;
|
||||
@@ -40,7 +40,7 @@ import static org.junit.Assert.*;
|
||||
* @author Marcin Kamionowski
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class EncoderHttpMessageWriterTest {
|
||||
public class EncoderHttpMessageWriterTests {
|
||||
|
||||
private MockServerHttpResponse response = new MockServerHttpResponse();
|
||||
|
||||
@@ -74,7 +74,6 @@ public class EncoderHttpMessageWriterTest {
|
||||
.verify();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private <T> EncoderHttpMessageWriter<T> createWriter(Encoder<T> encoder) {
|
||||
return new EncoderHttpMessageWriter<>(encoder);
|
||||
}
|
||||
@@ -20,7 +20,6 @@ import org.eclipse.jetty.server.Server;
|
||||
import org.eclipse.jetty.server.ServerConnector;
|
||||
import org.eclipse.jetty.servlet.ServletContextHandler;
|
||||
import org.eclipse.jetty.servlet.ServletHolder;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.http.server.reactive.ServletHttpHandlerAdapter;
|
||||
@@ -52,7 +51,6 @@ public class JettyHttpServer extends HttpServerSupport implements HttpServer, In
|
||||
this.jettyServer.addConnector(connector);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private ServletHttpHandlerAdapter initServletHttpHandlerAdapter() {
|
||||
if (getHttpHandlerMap() != null) {
|
||||
return new ServletHttpHandlerAdapter(getHttpHandlerMap());
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.io.File;
|
||||
import org.apache.catalina.Context;
|
||||
import org.apache.catalina.LifecycleException;
|
||||
import org.apache.catalina.startup.Tomcat;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.http.server.reactive.ServletHttpHandlerAdapter;
|
||||
@@ -64,7 +63,6 @@ public class TomcatHttpServer extends HttpServerSupport implements HttpServer, I
|
||||
rootContext.addServletMappingDecoded("/", "httpHandlerServlet");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private ServletHttpHandlerAdapter initServletHttpHandlerAdapter() {
|
||||
if (getHttpHandlerMap() != null) {
|
||||
return new ServletHttpHandlerAdapter(getHttpHandlerMap());
|
||||
|
||||
@@ -13,14 +13,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.springframework.web.bind;
|
||||
|
||||
package org.springframework.web.bind.support;
|
||||
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -227,7 +227,6 @@ public class WebExchangeDataBinderTests {
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private ServerWebExchange createExchange() {
|
||||
return new DefaultServerWebExchange(
|
||||
this.request, new MockServerHttpResponse(), new DefaultWebSessionManager());
|
||||
Reference in New Issue
Block a user