From 5bef156258fd5f68280ef92e206380f566d8d075 Mon Sep 17 00:00:00 2001 From: Keith Donald Date: Mon, 8 Jun 2009 04:28:36 +0000 Subject: [PATCH] removed binding failures - not yet needed --- .../springframework/ui/binding/Binder.java | 20 +++++++--- .../springframework/ui/binding/Binding.java | 19 +++++++-- .../ui/binding/BindingConfiguration.java | 15 +++++++ .../ui/binding/BindingFailure.java | 40 ------------------- .../ui/binding/BindingFailures.java | 15 ------- .../ui/binding/MessageCriteria.java | 5 --- .../springframework/ui/binding/Severity.java | 5 --- .../springframework/ui/message/Message.java | 8 ++-- 8 files changed, 49 insertions(+), 78 deletions(-) delete mode 100644 org.springframework.context/src/main/java/org/springframework/ui/binding/BindingFailure.java delete mode 100644 org.springframework.context/src/main/java/org/springframework/ui/binding/BindingFailures.java delete mode 100644 org.springframework.context/src/main/java/org/springframework/ui/binding/MessageCriteria.java delete mode 100644 org.springframework.context/src/main/java/org/springframework/ui/binding/Severity.java diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/Binder.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/Binder.java index 08620651ae..4672295924 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/Binder.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/Binder.java @@ -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; import java.lang.annotation.Annotation; @@ -101,7 +116,6 @@ public class Binder { } } - // TODO determine Annotation type from factory using reflection public void add(AnnotationFormatterFactory factory) { annotationFormatters.put(getAnnotationType(factory), factory); } @@ -209,10 +223,6 @@ public class Binder { setValue(values); } - public BindingFailures getFailures() { - return null; - } - // internal helpers private Object parse(String formatted, Formatter formatter) { diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/Binding.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/Binding.java index 9902e5378f..ba0a3d82d8 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/Binding.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/Binding.java @@ -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; public interface Binding { @@ -17,9 +32,5 @@ public interface Binding { String[] getValues(); void setValues(String[] formattedValues); - - // validation metadata - - BindingFailures getFailures(); } \ No newline at end of file diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingConfiguration.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingConfiguration.java index c6247de062..90f0b77d9e 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingConfiguration.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingConfiguration.java @@ -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; import org.springframework.ui.format.Formatter; diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingFailure.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingFailure.java deleted file mode 100644 index b84c60d252..0000000000 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingFailure.java +++ /dev/null @@ -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 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 getDetails(); -} diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingFailures.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingFailures.java deleted file mode 100644 index b2d3ac9821..0000000000 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/BindingFailures.java +++ /dev/null @@ -1,15 +0,0 @@ -package org.springframework.ui.binding; - -import java.util.List; - -public interface BindingFailures { - - int getCount(); - - Severity getMaximumSeverity(); - - List getAll(); - - List getBySeverity(Severity severity); - -} diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/MessageCriteria.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/MessageCriteria.java deleted file mode 100644 index d56ff6154a..0000000000 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/MessageCriteria.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.springframework.ui.binding; - -public interface MessageCriteria { - -} diff --git a/org.springframework.context/src/main/java/org/springframework/ui/binding/Severity.java b/org.springframework.context/src/main/java/org/springframework/ui/binding/Severity.java deleted file mode 100644 index 4d6f7f393c..0000000000 --- a/org.springframework.context/src/main/java/org/springframework/ui/binding/Severity.java +++ /dev/null @@ -1,5 +0,0 @@ -package org.springframework.ui.binding; - -public enum Severity { - INFO, WARNING, ERROR; -} diff --git a/org.springframework.context/src/main/java/org/springframework/ui/message/Message.java b/org.springframework.context/src/main/java/org/springframework/ui/message/Message.java index 84f880f161..48d5fbb340 100644 --- a/org.springframework.context/src/main/java/org/springframework/ui/message/Message.java +++ b/org.springframework.context/src/main/java/org/springframework/ui/message/Message.java @@ -1,8 +1,8 @@ /* - * Copyright 2004-2009 the original author oimport java.io.Serializable; - -import org.springframework.core.style.ToStringCreator; -ou may not use this file except in compliance with the License. + * 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