Example usage for org.springframework.core MethodParameter getExecutable

List of usage examples for org.springframework.core MethodParameter getExecutable

Introduction

In this page you can find the example usage for org.springframework.core MethodParameter getExecutable.

Prototype

public Executable getExecutable() 

Source Link

Document

Return the wrapped executable.

Usage

From source file:org.springframework.cloud.function.web.RequestProcessor.java

private ServerWebInputException handleMissingBody(MethodParameter param) {
    return new ServerWebInputException("Request body is missing: " + param.getExecutable().toGenericString());
}

From source file:org.springframework.messaging.handler.annotation.reactive.PayloadMethodArgumentResolver.java

private MethodArgumentResolutionException handleMissingBody(MethodParameter param, Message<?> message) {
    return new MethodArgumentResolutionException(message, param,
            "Payload content is missing: " + param.getExecutable().toGenericString());
}

From source file:org.springframework.web.method.annotation.ModelAttributeMethodProcessor.java

/**
 * Whether to raise a fatal bind exception on validation errors.
 * @param parameter the method parameter declaration
 * @return {@code true} if the next method parameter is not of type {@link Errors}
 * @since 5.0/* w ww .ja v a 2s.com*/
 */
protected boolean isBindExceptionRequired(MethodParameter parameter) {
    int i = parameter.getParameterIndex();
    Class<?>[] paramTypes = parameter.getExecutable().getParameterTypes();
    boolean hasBindingResult = (paramTypes.length > (i + 1)
            && Errors.class.isAssignableFrom(paramTypes[i + 1]));
    return !hasBindingResult;
}

From source file:org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.java

/**
 * Whether to raise a fatal bind exception on validation errors.
 * @param binder the data binder used to perform data binding
 * @param parameter the method parameter descriptor
 * @return {@code true} if the next method argument is not of type {@link Errors}
 * @since 4.1.5/*from   ww w . j  a  va  2s  . c  o m*/
 */
protected boolean isBindExceptionRequired(WebDataBinder binder, MethodParameter parameter) {
    int i = parameter.getParameterIndex();
    Class<?>[] paramTypes = parameter.getExecutable().getParameterTypes();
    boolean hasBindingResult = (paramTypes.length > (i + 1)
            && Errors.class.isAssignableFrom(paramTypes[i + 1]));
    return !hasBindingResult;
}