Polishing

This commit is contained in:
Juergen Hoeller
2015-08-21 17:03:53 +02:00
parent 6d1b8b5a31
commit c685fd7c23
4 changed files with 19 additions and 18 deletions

View File

@@ -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);
}