All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pub.codex.apix.annotations.factory.RequestParamFactory Maven / Gradle / Ivy

There is a newer version: 5.0.2
Show newest version
package pub.codex.apix.annotations.factory;

import org.springframework.core.MethodParameter;
import org.springframework.web.bind.annotation.RequestParam;

import java.lang.annotation.Annotation;

public class RequestParamFactory {


    /**
     * 获取 RequestParam 的必填信息
     *
     * @param methodParameter
     * @return
     */
    public static Boolean getRequired(MethodParameter methodParameter) {
        Annotation requestParamAnnotation = methodParameter.getParameterAnnotation(RequestParam.class);
        if (requestParamAnnotation != null) {
            return ((RequestParam) requestParamAnnotation).required();
        }

        return null;
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy