I declare an annotation that should only be used on class properties of primitive type or of java.lang.String type or when the property has been annotated with another annotation @Annot. How Do i ensure that the user does not annotate the wrong property? who do i enforce rather compile-time checking on the annotations?
You can use annotation processing for that. Unfortunately I don't have any experience to share, only this link (which may or may not be useful)
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.