[英]Java: reflection (at runtime) versus mirroring (at annotation processing)
I understand the general differences between the concepts of 我理解概念之间的一般差异
Class, Method, Field, Annotation, ...
), and 反射 (在运行时使用Class, Method, Field, Annotation, ...
),和 TypeMirror, TypeElement, ...
). 镜像 (使用TypeMirror, TypeElement, ...
在注释处理期间完成)。 But can someone please compare the two concepts in-depth (or point me to a resource, where it is done)? 但有人可以请深入比较这两个概念(或指向一个资源,它在哪里完成)?
For instance, which concept offers what kinds of information that the other does not offer... 例如,哪个概念提供了另一个不提供的信息......
Thank you. 谢谢。
javax.lang.model
are used to work with Java source code . javax.lang.model
中的类用于处理Java源代码 。 They were designed when Generics already existed and can (and have to) support them much more extensively, since they are used before type erasure happens. 它们是在Generics已经存在的情况下设计的,并且可以(并且必须)更广泛地支持它们,因为它们是在类型擦除发生之前使用的。 我想你会在本文中找到答案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.