diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/ConnectionHandle.java b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/ConnectionHandle.java index 4223dfed1a..7b361385ac 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/ConnectionHandle.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/datasource/ConnectionHandle.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2005 the original author or authors. + * Copyright 2002-2016 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. @@ -20,12 +20,13 @@ import java.sql.Connection; /** * Simple interface to be implemented by handles for a JDBC Connection. - * Used by JdoDialect, for example. + * Used by JpaDialect and JdoDialect, for example. * * @author Juergen Hoeller * @since 1.1 * @see SimpleConnectionHandle * @see ConnectionHolder + * @see org.springframework.orm.jpa.JpaDialect#getJdbcConnection * @see org.springframework.orm.jdo.JdoDialect#getJdbcConnection */ public interface ConnectionHandle { diff --git a/spring-web/src/main/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessor.java b/spring-web/src/main/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessor.java index c1d2fd5ce7..c8a54a7b52 100644 --- a/spring-web/src/main/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessor.java +++ b/spring-web/src/main/java/org/springframework/web/method/annotation/ModelAttributeMethodProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 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. @@ -37,23 +37,24 @@ import org.springframework.web.method.support.HandlerMethodReturnValueHandler; import org.springframework.web.method.support.ModelAndViewContainer; /** - * Resolves method arguments annotated with {@code @ModelAttribute} and handles - * return values from methods annotated with {@code @ModelAttribute}. + * Resolve {@code @ModelAttribute} annotated method arguments and handle + * return values from {@code @ModelAttribute} annotated methods. * - *

Model attributes are obtained from the model or if not found possibly - * created with a default constructor if it is available. Once created, the - * attributed is populated with request data via data binding and also - * validation may be applied if the argument is annotated with - * {@code @javax.validation.Valid}. + *

Model attributes are obtained from the model or created with a default + * constructor (and then added to the model). Once created the attribute is + * populated via data binding to Servlet request parameters. Validation may be + * applied if the argument is annotated with {@code @javax.validation.Valid}. + * or Spring's own {@code @org.springframework.validation.annotation.Validated}. * - *

When this handler is created with {@code annotationNotRequired=true}, + *

When this handler is created with {@code annotationNotRequired=true} * any non-simple type argument and return value is regarded as a model * attribute with or without the presence of an {@code @ModelAttribute}. * * @author Rossen Stoyanchev * @since 3.1 */ -public class ModelAttributeMethodProcessor implements HandlerMethodArgumentResolver, HandlerMethodReturnValueHandler { +public class ModelAttributeMethodProcessor + implements HandlerMethodArgumentResolver, HandlerMethodReturnValueHandler { protected final Log logger = LogFactory.getLog(getClass()); @@ -61,6 +62,7 @@ public class ModelAttributeMethodProcessor implements HandlerMethodArgumentResol /** + * Class constructor. * @param annotationNotRequired if "true", non-simple method arguments and * return values are considered model attributes with or without a * {@code @ModelAttribute} annotation. @@ -71,8 +73,9 @@ public class ModelAttributeMethodProcessor implements HandlerMethodArgumentResol /** - * Returns {@code true} if the parameter is annotated with {@link ModelAttribute} - * or in default resolution mode, and also if it is not a simple type. + * Returns {@code true} if the parameter is annotated with + * {@link ModelAttribute} or, if in default resolution mode, for any + * method parameter that is not a simple type. */ @Override public boolean supportsParameter(MethodParameter parameter) { @@ -100,8 +103,8 @@ public class ModelAttributeMethodProcessor implements HandlerMethodArgumentResol NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception { String name = ModelFactory.getNameForParameter(parameter); - Object attribute = (mavContainer.containsAttribute(name) ? - mavContainer.getModel().get(name) : createAttribute(name, parameter, binderFactory, webRequest)); + Object attribute = (mavContainer.containsAttribute(name) ? mavContainer.getModel().get(name) : + createAttribute(name, parameter, binderFactory, webRequest)); WebDataBinder binder = binderFactory.createBinder(webRequest, attribute, name); if (binder.getTarget() != null) { @@ -178,7 +181,8 @@ public class ModelAttributeMethodProcessor implements HandlerMethodArgumentResol /** * Return {@code true} if there is a method-level {@code @ModelAttribute} - * or if it is a non-simple type when {@code annotationNotRequired=true}. + * or, in default resolution mode, for any return value type that is not + * a simple type. */ public boolean supportsReturnType(MethodParameter returnType) { if (returnType.getMethodAnnotation(ModelAttribute.class) != null) { diff --git a/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java b/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java index 2c93058c5b..067d1052f7 100644 --- a/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java +++ b/spring-web/src/main/java/org/springframework/web/util/HtmlUtils.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2016 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. @@ -25,7 +25,7 @@ package org.springframework.web.util; * http://www.w3.org/TR/html4/charset.html * *

For a comprehensive set of String escaping utilities, - * consider Jakarta Commons Lang and its StringEscapeUtils class. + * consider Apache Commons Lang and its StringEscapeUtils class. * We are not using that class here to avoid a runtime dependency * on Commons Lang just for HTML escaping. Furthermore, Spring's * HTML escaping is more flexible and 100% HTML 4.0 compliant. @@ -33,7 +33,6 @@ package org.springframework.web.util; * @author Juergen Hoeller * @author Martin Kersten * @since 01.03.2003 - * @see org.apache.commons.lang.StringEscapeUtils */ public abstract class HtmlUtils {