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

cn.basics.authority.interfaces.Authority Maven / Gradle / Ivy

package cn.basics.authority.interfaces;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import cn.basics.authority.enums.AuthorityType;

//@Retention(RetentionPolicy.SOURCE)   //注解仅存在于源码中,在class字节码文件中不包含
//@Retention(RetentionPolicy.CLASS)     // 默认的保留策略,注解会在class字节码文件中存在,但运行时无法获得,
@Retention(RetentionPolicy.RUNTIME)  // 注解会在class字节码文件中存在,在运行时可以通过反射获取到
//@Target(ElementType.TYPE)   //接口、类、枚举、注解
//@Target(ElementType.FIELD) //字段、枚举的常量
@Target(ElementType.METHOD) //方法
//@Target(ElementType.PARAMETER) //方法参数
//@Target(ElementType.CONSTRUCTOR)  //构造函数
//@Target(ElementType.LOCAL_VARIABLE)//局部变量
//@Target(ElementType.ANNOTATION_TYPE)//注解
//@Target(ElementType.PACKAGE) ///包 
@Documented
//Documented 注解表明这个注解应该被 javadoc工具记录. 默认情况下,javadoc是不包括注解的. 但如果声明注解时指定了 @Documented,则它会被 javadoc 之类的工具处理, 所以注解类型信息也会被包括在生成的文档中.

public @interface Authority {
    /**是否验证登录、权限<默认登录和权限都验证>*/
    AuthorityType value() default AuthorityType.Validate;
    /**方法说明,若为空(空字符串)则获取权限名称*/
    String explain() default "";
    /**该方法是否记录日志<默认true>*/
    boolean addLog() default true;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy