Polish
This commit is contained in:
@@ -243,13 +243,12 @@ public final class ModelFactory {
|
||||
|
||||
|
||||
/**
|
||||
* Derive the model attribute name for a method parameter based on:
|
||||
* <ol>
|
||||
* <li>the parameter {@code @ModelAttribute} annotation value
|
||||
* <li>the parameter type
|
||||
* </ol>
|
||||
* Derive the model attribute name for the given method parameter based on
|
||||
* a {@code @ModelAttribute} parameter annotation (if present) or falling
|
||||
* back on parameter type based conventions.
|
||||
* @param parameter a descriptor for the method parameter
|
||||
* @return the derived name (never {@code null} or empty String)
|
||||
* @return the derived name
|
||||
* @see Conventions#getVariableNameForParameter(MethodParameter)
|
||||
*/
|
||||
public static String getNameForParameter(MethodParameter parameter) {
|
||||
ModelAttribute ann = parameter.getParameterAnnotation(ModelAttribute.class);
|
||||
|
||||
@@ -74,10 +74,7 @@ public class SessionAttributesHandler {
|
||||
this.attributeNames.addAll(Arrays.asList(annotation.names()));
|
||||
this.attributeTypes.addAll(Arrays.asList(annotation.types()));
|
||||
}
|
||||
|
||||
for (String attributeName : this.attributeNames) {
|
||||
this.knownAttributeNames.add(attributeName);
|
||||
}
|
||||
this.knownAttributeNames.addAll(this.attributeNames);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -90,7 +87,7 @@ public class SessionAttributesHandler {
|
||||
|
||||
/**
|
||||
* Whether the attribute name or type match the names and types specified
|
||||
* via {@code @SessionAttributes} in underlying controller.
|
||||
* via {@code @SessionAttributes} on the underlying controller.
|
||||
* <p>Attributes successfully resolved through this method are "remembered"
|
||||
* and subsequently used in {@link #retrieveAttributes(WebRequest)} and
|
||||
* {@link #cleanupAttributes(WebRequest)}.
|
||||
|
||||
Reference in New Issue
Block a user