@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface FruitName {
    String value() default "";
}

/**
*
元注解:
  @Target:
    取值:ElementType.method  作用于方法
      ...field         ..属性
      ...type         ..类,接口,枚举
      ...package       ..包
     ...constructor     ..构造器
      ...local_variable   ..局部变量
  @Retention
    取值:RetentionPolicy.runtime  一般取runtime 运行时有效
        ....class          .class文件中有效
        ....source          源文件中有效
  @Documented  用于生成java doc
  @Inherited   这个注释不仅能作用于此类,还能作用于此类的所有子类
   
*/

  

参考自 :

http://www.cnblogs.com/peida/archive/2013/04/24/3036689.html

http://www.cnblogs.com/peida/archive/2013/04/26/3038503.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-12
  • 2022-12-23
  • 2021-04-18
猜你喜欢
  • 2022-01-18
  • 2022-01-19
  • 2021-12-20
  • 2021-08-09
  • 2021-09-14
  • 2021-10-24
  • 2022-01-07
相关资源
相似解决方案