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

top.wboost.common.system.aop.JoinPointUtil Maven / Gradle / Ivy

package top.wboost.common.system.aop;

import java.lang.annotation.Annotation;
import java.lang.reflect.Method;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.reflect.MethodSignature;

import top.wboost.common.util.AnnotationUtil;

public class JoinPointUtil {

    public static  T getAnnotationByJoinPoint(JoinPoint joinPoint, Class annotationClass) {
        MethodSignature methodSignature = ((MethodSignature) joinPoint.getSignature());
        Method domethod = methodSignature.getMethod();
        T annotation = AnnotationUtil.getAnnotation(domethod, annotationClass);
        if (annotation != null) {
            return annotation;
        }
        return null;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy