Example usage for org.springframework.core MethodParameter hasParameterAnnotation

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

Introduction

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

Prototype

public <A extends Annotation> boolean hasParameterAnnotation(Class<A> annotationType) 

Source Link

Document

Return whether the parameter is declared with the given annotation type.

Usage

From source file:com.ace.erp.handler.CurrentUserMethodArgumentResolver.java

@Override
public boolean supportsParameter(MethodParameter parameter) {
    if (parameter.hasParameterAnnotation(CurrentUser.class)) {
        return true;
    }/*from  ww  w  .  ja  v a 2  s.  c  om*/
    return false;
}

From source file:com.linecorp.bot.spring.boot.support.LineBotServerArgumentProcessor.java

@Override
public boolean supportsParameter(MethodParameter parameter) {
    return parameter.hasParameterAnnotation(LineBotMessages.class);
}

From source file:ph.fingra.statisticsweb.security.CurrentUserHandlerMethodArgumentResolver.java

@Override
public boolean supportsParameter(MethodParameter methodParameter) {
    return methodParameter.hasParameterAnnotation(ActiveUser.class)
            && methodParameter.getParameterType().equals(FingraphUser.class);
}

From source file:com.naver.timetable.resolver.UserHandlerMethodArgumentResolver.java

/**
 * @param parameter/*from  w  w  w .  jav  a2  s.  c  o m*/
 * @return
 * @see org.springframework.web.method.support.HandlerMethodArgumentResolver#supportsParameter(org.springframework.core.MethodParameter)
 */
@Override
public boolean supportsParameter(MethodParameter parameter) {
    if (parameter.hasParameterAnnotation(SessionUser.class)
            && User.class.isAssignableFrom(parameter.getParameterType())) {
        return true;
    }
    return false;
}

From source file:com.wesley_acheson.spring.BackingBeanValueResolver.java

/**
 * Implementation of/*from   w w w. ja va  2  s. c  o m*/
 * {@link HandlerMethodArgumentResolver#supportsParameter(MethodParameter)}
 * that returns true if the method parameter is annotatated with
 * {@link BackingBean}.
 */
@Override
public boolean supportsParameter(MethodParameter parameter) {
    return parameter.hasParameterAnnotation(BackingBean.class);
}

From source file:org.chtijbug.drools.platform.web.annotation.JsonPathArgumentResolver.java

@Override
public boolean supportsParameter(MethodParameter parameter) {
    return parameter.hasParameterAnnotation(JsonArg.class);
}

From source file:org.sarons.spring4me.web.widget.bind.support.PrefParamMethodArgumentResolver.java

public boolean supportsParameter(MethodParameter parameter) {
    return parameter.hasParameterAnnotation(PrefParam.class);
}

From source file:net.kaczmarzyk.spring.data.jpa.web.JoinFetchSpecificationResolver.java

private boolean isAnnotatedWith(Class<? extends Annotation> annotation, MethodParameter param) {
    return param.hasParameterAnnotation(annotation) || param.getParameterType().isAnnotationPresent(annotation);
}

From source file:net.kaczmarzyk.spring.data.jpa.web.AndSpecificationResolver.java

@Override
public boolean supportsParameter(MethodParameter param) {
    return param.getParameterType() == Specification.class && param.hasParameterAnnotation(And.class);
}

From source file:net.kaczmarzyk.spring.data.jpa.web.OrSpecificationResolver.java

@Override
public boolean supportsParameter(MethodParameter param) {
    return param.getParameterType() == Specification.class && param.hasParameterAnnotation(Or.class);
}