interface 前加上 @ package javax.annotation.security;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotation.Target;@Target({ElementType.TYPE,ElementType

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/15 09:31:50
interface 前加上 @ package javax.annotation.security;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotation.Target;@Target({ElementType.TYPE,ElementType

interface 前加上 @ package javax.annotation.security;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotation.Target;@Target({ElementType.TYPE,ElementType
interface 前加上 @
package javax.annotation.security;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Target({ElementType.TYPE,ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface RolesAllowed {
public String[] value();
}

interface 前加上 @ package javax.annotation.security;import java.lang.annotation.ElementType;import java.lang.annotation.Retention;import java.lang.annotation.RetentionPolicy;import java.lang.annotation.Target;@Target({ElementType.TYPE,ElementType
@interface 不是interface,是注解类
是jdk1.5之后加入的,java没有给它新的关键字,所以就用@interface 这么个东西表示了
这个注解类,就是定义一个可用的注解,包括这个注解用于什么地方,是类,还是方法,还是property,还是方法入参等等,还有这个注解是否编译后进入class
比如我们知道的用于javadoc的注解,是不进入class文件的.然后在后面你就可以用这个注解写代码了.
总的来说,这就是一个生成javadoc时用到的注释类