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

com.yeskery.nut.aop.aspect.joinpoint.AnnotationJoinPoint Maven / Gradle / Ivy

The newest version!
package com.yeskery.nut.aop.aspect.joinpoint;

import com.yeskery.nut.aop.aspect.JoinPoint;

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

/**
 * 基于注解的连接点
 * @author Yeskery
 * 2023/8/4
 */
public class AnnotationJoinPoint implements JoinPoint {

    /** 注解的类型 */
    private final Class annotationClass;

    /**
     * 构建基于注解的连接点
     * @param annotationClass 注解的类型
     */
    public AnnotationJoinPoint(Class annotationClass) {
        this.annotationClass = annotationClass;
    }

    @Override
    public boolean isTargetMethod(Method method) {
        return method.isAnnotationPresent(annotationClass);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy