overhaul of support package arrangements for handler method processing; added missing package-info files

This commit is contained in:
Juergen Hoeller
2011-12-12 23:20:03 +00:00
parent 2065b788c4
commit 1c45c51fe1
79 changed files with 194 additions and 149 deletions

View File

@@ -14,25 +14,25 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.bind;
import org.springframework.core.MethodParameter;
import org.springframework.validation.BindingResult;
import org.springframework.validation.ObjectError;
/**
* Thrown when validation on an argument annotated with {@code @Valid} fails.
*
* Exception to be thrown when validation on an argument annotated with {@code @Valid} fails.
*
* @author Rossen Stoyanchev
* @since 3.1
*/
@SuppressWarnings("serial")
public class MethodArgumentNotValidException extends Exception {
private final MethodParameter parameter;
private final BindingResult bindingResult;
/**
* Constructor for {@link MethodArgumentNotValidException}.
* @param parameter the parameter that failed validation
@@ -47,23 +47,24 @@ public class MethodArgumentNotValidException extends Exception {
* Return the method parameter that failed validation.
*/
public MethodParameter getParameter() {
return parameter;
return this.parameter;
}
/**
* Return the results of the failed validation.
*/
public BindingResult getBindingResult() {
return bindingResult;
return this.bindingResult;
}
@Override
public String getMessage() {
StringBuilder sb = new StringBuilder("Validation failed for argument at index [")
.append(parameter.getParameterIndex()).append("] in method: ")
.append(parameter.getMethod().toGenericString())
.append(", with ").append(bindingResult.getErrorCount()).append(" error(s): ");
for (ObjectError error : bindingResult.getAllErrors()) {
StringBuilder sb = new StringBuilder("Validation failed for argument at index ")
.append(this.parameter.getParameterIndex()).append(" in method: ")
.append(this.parameter.getMethod().toGenericString())
.append(", with ").append(this.bindingResult.getErrorCount()).append(" error(s): ");
for (ObjectError error : this.bindingResult.getAllErrors()) {
sb.append("[").append(error).append("] ");
}
return sb.toString();

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.core.MethodParameter;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import java.util.ArrayList;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import javax.servlet.ServletException;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import java.util.Map;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import java.lang.annotation.Annotation;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import org.springframework.core.MethodParameter;
import org.springframework.ui.Model;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import java.util.Iterator;
import java.util.LinkedHashMap;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import java.util.Map;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import java.util.LinkedHashMap;
import java.util.Map;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import java.beans.PropertyEditor;
import java.util.Collection;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package org.springframework.web.method.annotation.support;
package org.springframework.web.method.annotation;
import org.springframework.core.MethodParameter;
import org.springframework.web.bind.support.SessionStatus;

View File

@@ -0,0 +1,8 @@
/**
*
* Support classes for annotation-based handler method processing.
*
*/
package org.springframework.web.method.annotation;

View File

@@ -0,0 +1,9 @@
/**
*
* Common infrastructure for handler method processing, as used by
* Spring MVC's <code>org.springframework.web.servlet.mvc.method</code> package.
*
*/
package org.springframework.web.method;

View File

@@ -0,0 +1,8 @@
/**
*
* Generic support classes for handler method processing.
*
*/
package org.springframework.web.method.support;