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

com.cybermkd.common.util.scan.AnnotationScaner Maven / Gradle / Ivy

package com.cybermkd.common.util.scan;

import java.lang.annotation.Annotation;

/**
 * Created by ice on 14-12-19.
 */
public class AnnotationScaner extends Scaner {

    private Class target;

    public AnnotationScaner(Class target) {
        this.target = target;
    }

    /**
     * 要扫描的类父级
     *
     * @param target class
     * @return scaner
     */
    public static AnnotationScaner of(Class target) {
        return new AnnotationScaner(target);
    }

    /**
     * 检测目标类
     *
     * @param clazz
     * @return
     */
    public boolean checkTarget(Class clazz) {
        return clazz.getAnnotation(target) != null;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy