removed binding failures - not yet needed
This commit is contained in:
parent
065102bca9
commit
5bef156258
|
|
@ -1,3 +1,18 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2004-2009 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.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.springframework.ui.binding;
|
package org.springframework.ui.binding;
|
||||||
|
|
||||||
import java.lang.annotation.Annotation;
|
import java.lang.annotation.Annotation;
|
||||||
|
|
@ -101,7 +116,6 @@ public class Binder<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO determine Annotation type from factory using reflection
|
|
||||||
public void add(AnnotationFormatterFactory<?, ?> factory) {
|
public void add(AnnotationFormatterFactory<?, ?> factory) {
|
||||||
annotationFormatters.put(getAnnotationType(factory), factory);
|
annotationFormatters.put(getAnnotationType(factory), factory);
|
||||||
}
|
}
|
||||||
|
|
@ -209,10 +223,6 @@ public class Binder<T> {
|
||||||
setValue(values);
|
setValue(values);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BindingFailures getFailures() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// internal helpers
|
// internal helpers
|
||||||
|
|
||||||
private Object parse(String formatted, Formatter formatter) {
|
private Object parse(String formatted, Formatter formatter) {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,18 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2004-2009 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.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.springframework.ui.binding;
|
package org.springframework.ui.binding;
|
||||||
|
|
||||||
public interface Binding {
|
public interface Binding {
|
||||||
|
|
@ -18,8 +33,4 @@ public interface Binding {
|
||||||
|
|
||||||
void setValues(String[] formattedValues);
|
void setValues(String[] formattedValues);
|
||||||
|
|
||||||
// validation metadata
|
|
||||||
|
|
||||||
BindingFailures getFailures();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1,3 +1,18 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2004-2009 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.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
package org.springframework.ui.binding;
|
package org.springframework.ui.binding;
|
||||||
|
|
||||||
import org.springframework.ui.format.Formatter;
|
import org.springframework.ui.format.Formatter;
|
||||||
|
|
|
||||||
|
|
@ -1,40 +0,0 @@
|
||||||
package org.springframework.ui.binding;
|
|
||||||
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public interface BindingFailure {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The code identifying the type of failure.
|
|
||||||
* This code can be used to resolve the failure message if no explicit {@link #getMessage() message} is configured.
|
|
||||||
*/
|
|
||||||
String getCode();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The severity of the failure, which measures the impact of the failure on the user.
|
|
||||||
*/
|
|
||||||
Severity getSeverity();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An map of arguments that can be used as named parameters in resolvable messages associated with this failure.
|
|
||||||
* Each constraint defines a set of arguments that are specific to it. For example, a length
|
|
||||||
* constraint might define arguments of "min" and "max" of Integer values. In the message bundle, you then might see
|
|
||||||
* "length=The ${label} field value must be between ${min} and ${max}". Returns an empty map if no arguments are present.
|
|
||||||
*/
|
|
||||||
Map<String, Object> getArguments();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The message summarizing this failure. May be a literal string or a resolvable message code. Can be null.
|
|
||||||
* If null, the failure message will be resolved using the failure code.
|
|
||||||
*/
|
|
||||||
String getDefaultMessage();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A map of details providing additional information about this failure. Each entry in this map is a failure detail
|
|
||||||
* item that has a name and value. The name uniquely identifies the failure detail and describes its purpose;
|
|
||||||
* for example, a "cause" or "recommendedAction". The value is the failure detail message, either a literal string or
|
|
||||||
* resolvable code. If resolvable, the detail code is resolved relative to this failure.
|
|
||||||
* Returns an empty map if no details are present.
|
|
||||||
*/
|
|
||||||
Map<String, String> getDetails();
|
|
||||||
}
|
|
||||||
|
|
@ -1,15 +0,0 @@
|
||||||
package org.springframework.ui.binding;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public interface BindingFailures {
|
|
||||||
|
|
||||||
int getCount();
|
|
||||||
|
|
||||||
Severity getMaximumSeverity();
|
|
||||||
|
|
||||||
List<BindingFailure> getAll();
|
|
||||||
|
|
||||||
List<BindingFailure> getBySeverity(Severity severity);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
package org.springframework.ui.binding;
|
|
||||||
|
|
||||||
public interface MessageCriteria {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,5 +0,0 @@
|
||||||
package org.springframework.ui.binding;
|
|
||||||
|
|
||||||
public enum Severity {
|
|
||||||
INFO, WARNING, ERROR;
|
|
||||||
}
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2004-2009 the original author oimport java.io.Serializable;
|
* Copyright 2004-2009 the original author or authors.
|
||||||
|
*
|
||||||
import org.springframework.core.style.ToStringCreator;
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
ou may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue