zoukankan      html  css  js  c++  java
  • Java custom annotations

    Custom annotation definition is similar as Interface, just with @ in front. Annotation interface itself can have or have not annotations. @Retention(RetentionPolicy.RUNTIME) means VM will retain annotation with this type so they can be read reflectively at run-time.

    Java defines a set of annotations that are build into the language:

    Annotations applied to Java code: 1, @Override  2, @Deprecated  3, @SuppressWarnings

    Annotations applied to other annotations: 1, @Retention(specifies how the marked annotation is stored)   2, @Documented  3, @Target(specifies where this annotation can be applied to)   4, @Inherited

    Unlike interface method declarations, custom annotation have method like "int retryCount() default 5;", "default" keyword is only for java annotations. If you want to use another value, when using this custom annotation, @FluentInterface(retryCount=6).

  • 相关阅读:
    刚体动力学
    碰撞检测系统
    动画系统II
    动画系统
    Game Develop Books
    光照技术
    LR参数组取值操作方法
    loadrunner测试ajax框架
    ​Web(click and script) 与 Web(HTTP/HTML)协议区别
    性能测试常用的linux命令
  • 原文地址:https://www.cnblogs.com/chayu3/p/3252976.html
Copyright © 2011-2022 走看看