How to use custom type annotations in Java

前端 未结 3 1072
[愿得一人]
[愿得一人] 2021-02-14 13:21

Java 8 has feature called Type annotations (JSR 308). I would like to use it for simple Object to Object mapper framework. I would like define annotation @ExpectedType like this

3条回答
  •  我寻月下人不归
    2021-02-14 13:31

    I think you're mixing up the use of annotations at run time versus the use of same at "compile" time by various tools. Processor interface is for use in tools (compiler, javadoc generator), not in your runtime code.

提交回复
热议问题