简体   繁体   中英

How to create a custom Annotation and processing it using APT?

I'm new to Java Annotation. I know how to create custom annotation but I don't know how to process that Annotation to generate the dynamic code just like ejb 3.0 and hibernate does.
I read some articles based on APT but no one gives the details about how to process the Annotation.
Are there any tutorials with sample code for processing custom Annotations?

Thanks

Start with... the apt getting started guide . To go further, you could maybe have a look at the sources of annotation processor used by JPA 2.0 providers to generate the static meta model classes, for example Hibernate's one: ohjJPAMetaModelEntityProcessor.java

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM