Skip to content Skip to sidebar Skip to footer

How To Pass / Access Annotation Information?

Example of my current Book class which I am trying to apply annotations to: @DatabaseTable(tableName = 'books') public class Book { @DatabaseField(generatedId = true) priv

Solution 1:

Oracle has some good documentation on this: https://docs.oracle.com/javase/tutorial/java/annotations/http://www.oracle.com/technetwork/articles/hunter-meta-2-098036.html

The topic is complex and there are a lot of steps to it, so it is not suitable for a quick summary here. You declare a special kind of interface using @interface TypeName and fill in some logic, typically using reflection.

It is something you should study thoroughly and practice before releasing code to clients.

Post a Comment for "How To Pass / Access Annotation Information?"