提交 5b912972 编写于 作者: J Juergen Hoeller

Polishing

上级 c14d2d37
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 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.
......@@ -84,8 +84,9 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
*/
public DependencyDescriptor(MethodParameter methodParameter, boolean required, boolean eager) {
super(methodParameter);
this.declaringClass = methodParameter.getDeclaringClass();
if (this.methodParameter.getMethod() != null) {
if (methodParameter.getMethod() != null) {
this.methodName = methodParameter.getMethod().getName();
this.parameterTypes = methodParameter.getMethod().getParameterTypes();
}
......@@ -117,6 +118,7 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
*/
public DependencyDescriptor(Field field, boolean required, boolean eager) {
super(field);
this.declaringClass = field.getDeclaringClass();
this.fieldName = field.getName();
this.required = required;
......@@ -129,6 +131,7 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
*/
public DependencyDescriptor(DependencyDescriptor original) {
super(original);
this.declaringClass = original.declaringClass;
this.methodName = original.methodName;
this.parameterTypes = original.parameterTypes;
......@@ -236,7 +239,7 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
}
/**
* Build a ResolvableType object for the wrapped parameter/field.
* Build a {@link ResolvableType} object for the wrapped parameter/field.
* @since 4.0
*/
public ResolvableType getResolvableType() {
......
......@@ -45,8 +45,8 @@ public class HandlerMethodArgumentResolverComposite implements HandlerMethodArgu
/**
* Add the given {@link HandlerMethodArgumentResolver}.
*/
public HandlerMethodArgumentResolverComposite addResolver(HandlerMethodArgumentResolver argumentResolver) {
this.argumentResolvers.add(argumentResolver);
public HandlerMethodArgumentResolverComposite addResolver(HandlerMethodArgumentResolver resolver) {
this.argumentResolvers.add(resolver);
return this;
}
......@@ -99,8 +99,7 @@ public class HandlerMethodArgumentResolverComposite implements HandlerMethodArgu
* Iterate over registered
* {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers}
* and invoke the one that supports it.
* @throws IllegalStateException if no suitable
* {@link HandlerMethodArgumentResolver} is found.
* @throws IllegalArgumentException if no suitable argument resolver is found
*/
@Override
public Object resolveArgument(MethodParameter parameter, Message<?> message) throws Exception {
......
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 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.
......@@ -431,6 +431,7 @@ public enum HttpStatus {
* Whether this status code is in the HTTP series
* {@link org.springframework.http.HttpStatus.Series#INFORMATIONAL}.
* This is a shortcut for checking the value of {@link #series()}.
* @since 4.0
* @see #series()
*/
public boolean is1xxInformational() {
......@@ -441,6 +442,7 @@ public enum HttpStatus {
* Whether this status code is in the HTTP series
* {@link org.springframework.http.HttpStatus.Series#SUCCESSFUL}.
* This is a shortcut for checking the value of {@link #series()}.
* @since 4.0
* @see #series()
*/
public boolean is2xxSuccessful() {
......@@ -451,6 +453,7 @@ public enum HttpStatus {
* Whether this status code is in the HTTP series
* {@link org.springframework.http.HttpStatus.Series#REDIRECTION}.
* This is a shortcut for checking the value of {@link #series()}.
* @since 4.0
* @see #series()
*/
public boolean is3xxRedirection() {
......@@ -461,6 +464,7 @@ public enum HttpStatus {
* Whether this status code is in the HTTP series
* {@link org.springframework.http.HttpStatus.Series#CLIENT_ERROR}.
* This is a shortcut for checking the value of {@link #series()}.
* @since 4.0
* @see #series()
*/
public boolean is4xxClientError() {
......@@ -471,6 +475,7 @@ public enum HttpStatus {
* Whether this status code is in the HTTP series
* {@link org.springframework.http.HttpStatus.Series#SERVER_ERROR}.
* This is a shortcut for checking the value of {@link #series()}.
* @since 4.0
* @see #series()
*/
public boolean is5xxServerError() {
......
......@@ -106,10 +106,9 @@ public class HandlerMethodArgumentResolverComposite implements HandlerMethodArgu
/**
* Iterate over registered
* {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers} and
* invoke the one that supports it.
* @throws IllegalStateException if no suitable
* {@link HandlerMethodArgumentResolver} is found.
* {@link HandlerMethodArgumentResolver HandlerMethodArgumentResolvers}
* and invoke the one that supports it.
* @throws IllegalArgumentException if no suitable argument resolver is found
*/
@Override
public Object resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
......@@ -130,9 +129,9 @@ public class HandlerMethodArgumentResolverComposite implements HandlerMethodArgu
private HandlerMethodArgumentResolver getArgumentResolver(MethodParameter parameter) {
HandlerMethodArgumentResolver result = this.argumentResolverCache.get(parameter);
if (result == null) {
for (HandlerMethodArgumentResolver methodArgumentResolver : this.argumentResolvers) {
if (methodArgumentResolver.supportsParameter(parameter)) {
result = methodArgumentResolver;
for (HandlerMethodArgumentResolver resolver : this.argumentResolvers) {
if (resolver.supportsParameter(parameter)) {
result = resolver;
this.argumentResolverCache.put(parameter, result);
break;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册