Annotations can not only be obtained through reflection, but also bytecode can be generated at compile time through annotations, which is more efficient than reflection. The usual way to optimize reflection is to generate bytecode dynamically, such as cglib,静态生成比如Javassist.
Annotations can not only be obtained through reflection, but also bytecode can be generated at compile time through annotations, which is more efficient than reflection.
The usual way to optimize reflection is to generate bytecode dynamically, such as
cglib
,静态生成比如Javassist
.