Java Code Examples for org.springframework.web.bind.annotation.RequestBody#required()

The following examples show how to use org.springframework.web.bind.annotation.RequestBody#required() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RequestResponseBodyMethodProcessor.java    From spring-analysis-note with MIT License 4 votes vote down vote up
protected boolean checkRequired(MethodParameter parameter) {
	RequestBody requestBody = parameter.getParameterAnnotation(RequestBody.class);
	return (requestBody != null && requestBody.required() && !parameter.isOptional());
}
 
Example 2
Source File: MvcAnnotationPredicates.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public boolean test(MethodParameter parameter) {
	RequestBody annotation = parameter.getParameterAnnotation(RequestBody.class);
	return annotation != null && annotation.required() == this.required;
}
 
Example 3
Source File: RequestResponseBodyMethodProcessor.java    From java-technology-stack with MIT License 4 votes vote down vote up
protected boolean checkRequired(MethodParameter parameter) {
	RequestBody requestBody = parameter.getParameterAnnotation(RequestBody.class);
	return (requestBody != null && requestBody.required() && !parameter.isOptional());
}
 
Example 4
Source File: MvcAnnotationPredicates.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public boolean test(MethodParameter parameter) {
	RequestBody annotation = parameter.getParameterAnnotation(RequestBody.class);
	return annotation != null && annotation.required() == this.required;
}