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

1

2

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

Carolanncarole answered 18/5, 2010 at 16:54 Comment(0)
A
1

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: o.h.j.JPAMetaModelEntityProcessor.java

Angstrom answered 18/5, 2010 at 18:48 Comment(1)
apt getting started guide has moved to download.oracle.com/javase/1.5.0/docs/guide/apt/…Mystery

© 2022 - 2024 — McMap. All rights reserved.