
com.github.bingoohuang.springrest.boot.advisor.RequestMappingAdvisor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-rest-boot Show documentation
Show all versions of spring-rest-boot Show documentation
convenient spring rest server on spring boot
package com.github.bingoohuang.springrest.boot.advisor;
import org.aopalliance.aop.Advice;
import org.springframework.aop.Pointcut;
import org.springframework.aop.support.AbstractPointcutAdvisor;
import org.springframework.aop.support.StaticMethodMatcherPointcut;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestMapping;
import java.lang.reflect.Method;
@Component
public class RequestMappingAdvisor extends AbstractPointcutAdvisor {
final StaticMethodMatcherPointcut pointcut = new StaticMethodMatcherPointcut() {
@Override
public boolean matches(Method method, Class> targetClass) {
return method.isAnnotationPresent(RequestMapping.class);
}
};
NullReturnValueInterceptor interceptor = new NullReturnValueInterceptor();
@Override
public Pointcut getPointcut() {
return this.pointcut;
}
@Override
public Advice getAdvice() {
return this.interceptor;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy