Removed model parameterized type after review with juergen
This commit is contained in:
@@ -29,13 +29,13 @@ import org.springframework.ui.format.Formatter;
|
||||
* @see #add(BindingConfiguration)
|
||||
* @see #bind(UserValues)
|
||||
*/
|
||||
public interface Binder<M> {
|
||||
public interface Binder {
|
||||
|
||||
/**
|
||||
* The model object this binder binds to.
|
||||
* @return the model object
|
||||
*/
|
||||
M getModel();
|
||||
Object getModel();
|
||||
|
||||
/**
|
||||
* Configures if this binder is <i>strict</i>; a strict binder requires all bindings to be registered explicitly using {@link #add(BindingConfiguration)}.
|
||||
|
||||
@@ -55,17 +55,15 @@ import org.springframework.ui.format.Formatter;
|
||||
/**
|
||||
* Binds user-entered values to properties of a model object.
|
||||
* @author Keith Donald
|
||||
*
|
||||
* @param <M> The type of model object this binder binds to - TODO is this worth it?
|
||||
* @see #add(BindingConfiguration)
|
||||
* @see #bind(UserValues)
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public class GenericBinder<M> implements Binder<M> {
|
||||
public class GenericBinder implements Binder {
|
||||
|
||||
private static final String[] EMPTY_STRING_ARRAY = new String[0];
|
||||
|
||||
private M model;
|
||||
private Object model;
|
||||
|
||||
private Map<String, Binding> bindings;
|
||||
|
||||
@@ -101,7 +99,7 @@ public class GenericBinder<M> implements Binder<M> {
|
||||
* Creates a new binder for the model object.
|
||||
* @param model the model object containing properties this binder will bind to
|
||||
*/
|
||||
public GenericBinder(M model) {
|
||||
public GenericBinder(Object model) {
|
||||
this.model = model;
|
||||
bindings = new HashMap<String, Binding>();
|
||||
int parserConfig = SpelExpressionParserConfiguration.CreateListsOnAttemptToIndexIntoNull
|
||||
@@ -110,7 +108,7 @@ public class GenericBinder<M> implements Binder<M> {
|
||||
typeConverter = new DefaultTypeConverter();
|
||||
}
|
||||
|
||||
public M getModel() {
|
||||
public Object getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,11 +23,10 @@ import org.springframework.ui.binding.UserValues;
|
||||
* A binder designed for use in HTTP (web) environments.
|
||||
* Suited for binding user-provided HTTP query parameters to model properties.
|
||||
* @author Keith Donald
|
||||
* @param <M> The type of model object this binder binds to
|
||||
* @see #setFieldDefaultPrefix(String)
|
||||
* @see #setFieldMarkerPrefix(String)
|
||||
*/
|
||||
public class WebBinder<M> extends GenericBinder<M> {
|
||||
public class WebBinder extends GenericBinder {
|
||||
|
||||
private String fieldMarkerPrefix = "_";
|
||||
|
||||
@@ -37,7 +36,7 @@ public class WebBinder<M> extends GenericBinder<M> {
|
||||
* Creates a new web binder for the model object.
|
||||
* @param model the model object containing properties this binder will bind to
|
||||
*/
|
||||
public WebBinder(M model) {
|
||||
public WebBinder(Object model) {
|
||||
super(model);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user