Polishing
This commit is contained in:
parent
6d1b8b5a31
commit
c685fd7c23
|
@ -260,8 +260,9 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create the {@link AbstractPropertyBindingResult} instance using standard JavaBean
|
||||
* property access.
|
||||
* Create the {@link AbstractPropertyBindingResult} instance using standard
|
||||
* JavaBean property access.
|
||||
* @since 4.2.1
|
||||
*/
|
||||
protected AbstractPropertyBindingResult createBeanPropertyBindingResult() {
|
||||
BeanPropertyBindingResult result = new BeanPropertyBindingResult(getTarget(),
|
||||
|
@ -285,8 +286,9 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
|
|||
}
|
||||
|
||||
/**
|
||||
* Create the {@link AbstractPropertyBindingResult} instance using direct field
|
||||
* access.
|
||||
* Create the {@link AbstractPropertyBindingResult} instance using direct
|
||||
* field access.
|
||||
* @since 4.2.1
|
||||
*/
|
||||
protected AbstractPropertyBindingResult createDirectFieldBindingResult() {
|
||||
DirectFieldBindingResult result = new DirectFieldBindingResult(getTarget(),
|
||||
|
@ -299,7 +301,7 @@ public class DataBinder implements PropertyEditorRegistry, TypeConverter {
|
|||
|
||||
/**
|
||||
* Return the internal BindingResult held by this DataBinder,
|
||||
* as AbstractPropertyBindingResult.
|
||||
* as an AbstractPropertyBindingResult.
|
||||
*/
|
||||
protected AbstractPropertyBindingResult getInternalBindingResult() {
|
||||
if (this.bindingResult == null) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
|
@ -30,14 +30,17 @@ public class DefaultDataBinderFactory implements WebDataBinderFactory {
|
|||
|
||||
private final WebBindingInitializer initializer;
|
||||
|
||||
|
||||
/**
|
||||
* Create new instance.
|
||||
* @param initializer for global data binder intialization, or {@code null}
|
||||
* Create a new {@code DefaultDataBinderFactory} instance.
|
||||
* @param initializer for global data binder initialization
|
||||
* (or {@code null} if none)
|
||||
*/
|
||||
public DefaultDataBinderFactory(WebBindingInitializer initializer) {
|
||||
this.initializer = initializer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create a new {@link WebDataBinder} for the given target object and
|
||||
* initialize it through a {@link WebBindingInitializer}.
|
||||
|
@ -46,6 +49,7 @@ public class DefaultDataBinderFactory implements WebDataBinderFactory {
|
|||
@Override
|
||||
public final WebDataBinder createBinder(NativeWebRequest webRequest, Object target, String objectName)
|
||||
throws Exception {
|
||||
|
||||
WebDataBinder dataBinder = createBinderInstance(target, objectName, webRequest);
|
||||
if (this.initializer != null) {
|
||||
this.initializer.initBinder(dataBinder, webRequest);
|
||||
|
@ -64,6 +68,7 @@ public class DefaultDataBinderFactory implements WebDataBinderFactory {
|
|||
*/
|
||||
protected WebDataBinder createBinderInstance(Object target, String objectName, NativeWebRequest webRequest)
|
||||
throws Exception {
|
||||
|
||||
return new WebRequestDataBinder(target, objectName);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
|
@ -338,7 +338,7 @@ public abstract class AbstractView extends WebApplicationObjectSupport implement
|
|||
|
||||
/**
|
||||
* Create a RequestContext to expose under the specified attribute name.
|
||||
* <p>Default implementation creates a standard RequestContext instance for the
|
||||
* <p>The default implementation creates a standard RequestContext instance for the
|
||||
* given request and model. Can be overridden in subclasses for custom instances.
|
||||
* @param request current HTTP request
|
||||
* @param model combined output Map (never {@code null}),
|
||||
|
|
|
@ -104,7 +104,7 @@ public class UndertowXhrTransport extends AbstractXhrTransport implements XhrTra
|
|||
}
|
||||
|
||||
public UndertowXhrTransport(OptionMap optionMap) throws IOException {
|
||||
Assert.notNull(optionMap, "'optionMap' is required");
|
||||
Assert.notNull(optionMap, "OptionMap is required");
|
||||
this.httpClient = UndertowClient.getInstance();
|
||||
this.optionMap = optionMap;
|
||||
this.worker = Xnio.getInstance().createWorker(optionMap);
|
||||
|
@ -142,12 +142,11 @@ public class UndertowXhrTransport extends AbstractXhrTransport implements XhrTra
|
|||
final SettableListenableFuture<WebSocketSession> connectFuture) {
|
||||
|
||||
if (logger.isTraceEnabled()) {
|
||||
logger.trace("Starting XHR receive request, url=" + url);
|
||||
logger.trace("Starting XHR receive request for " + url);
|
||||
}
|
||||
|
||||
this.httpClient.connect(
|
||||
new ClientCallback<ClientConnection>() {
|
||||
|
||||
@Override
|
||||
public void completed(ClientConnection connection) {
|
||||
ClientRequest request = new ClientRequest().setMethod(Methods.POST).setPath(url.getPath());
|
||||
|
@ -158,7 +157,6 @@ public class UndertowXhrTransport extends AbstractXhrTransport implements XhrTra
|
|||
connection.sendRequest(request, createReceiveCallback(transportRequest,
|
||||
url, httpHeaders, session, connectFuture));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failed(IOException ex) {
|
||||
throw new SockJsTransportFailureException("Failed to execute request to " + url, ex);
|
||||
|
@ -181,11 +179,9 @@ public class UndertowXhrTransport extends AbstractXhrTransport implements XhrTra
|
|||
final SettableListenableFuture<WebSocketSession> connectFuture) {
|
||||
|
||||
return new ClientCallback<ClientExchange>() {
|
||||
|
||||
@Override
|
||||
public void completed(final ClientExchange exchange) {
|
||||
exchange.setResponseListener(new ClientCallback<ClientExchange>() {
|
||||
|
||||
@Override
|
||||
public void completed(ClientExchange result) {
|
||||
ClientResponse response = result.getResponse();
|
||||
|
@ -216,7 +212,6 @@ public class UndertowXhrTransport extends AbstractXhrTransport implements XhrTra
|
|||
onFailure(exc);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void failed(IOException exc) {
|
||||
IoUtils.safeClose(exchange.getConnection());
|
||||
|
@ -307,7 +302,6 @@ public class UndertowXhrTransport extends AbstractXhrTransport implements XhrTra
|
|||
final List<ClientResponse> responses, final CountDownLatch latch) {
|
||||
|
||||
return new ClientCallback<ClientExchange>() {
|
||||
|
||||
@Override
|
||||
public void completed(ClientExchange result) {
|
||||
result.setResponseListener(new ClientCallback<ClientExchange>() {
|
||||
|
|
Loading…
Reference in New Issue