注解技术
-
普通注解
- @Override @Deprecated @SupressWarnings
-
元注解:注解其他注解的注解
- @Documented:被javaDoc工具记录
- @Target:使用范围
- @Rention:描述注解生命周期
- @Inherited:可继承,class子类
-
自定义注解
public @interface test()
-
ButterKnife的BindView注解
- 作用域class,编译时生成,所以会影响编译速度,但是不影响运行时的速度
@Retention(CLASS) @Target(FIELD) public @interface BindView { /** View ID to which the field will be bound. */ @IdRes int value(); }