org.springframework.web.bind.annotation.RequestBody#required ( )源码实例Demo

下面列出了org.springframework.web.bind.annotation.RequestBody#required ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

protected boolean checkRequired(MethodParameter parameter) {
	RequestBody requestBody = parameter.getParameterAnnotation(RequestBody.class);
	return (requestBody != null && requestBody.required() && !parameter.isOptional());
}
 
@Override
public boolean test(MethodParameter parameter) {
	RequestBody annotation = parameter.getParameterAnnotation(RequestBody.class);
	return annotation != null && annotation.required() == this.required;
}
 
protected boolean checkRequired(MethodParameter parameter) {
	RequestBody requestBody = parameter.getParameterAnnotation(RequestBody.class);
	return (requestBody != null && requestBody.required() && !parameter.isOptional());
}
 
@Override
public boolean test(MethodParameter parameter) {
	RequestBody annotation = parameter.getParameterAnnotation(RequestBody.class);
	return annotation != null && annotation.required() == this.required;
}