How are annotations implemented

A

areale

My question is pretty simple in its form, but I could not manage to
find anything about it searching the web.
How are annotations implemented in the JVM?
More specifically, how are they represented in the bytecode wrt
different retentions policies?

I'd be very grateful if someone can help me or point me some useful
resource about it.

Thank you,
andrea
 
J

Joshua Cranmer

areale said:
My question is pretty simple in its form, but I could not manage to
find anything about it searching the web.
How are annotations implemented in the JVM?
More specifically, how are they represented in the bytecode wrt
different retentions policies?

Unfortunately, the JVM as published in HTML format does not represent
the changes in Java 5 or 6, so you have to make do with this PDF file:
<http://java.sun.com/docs/books/jvms/second_edition/ClassFileFormat-Java5.pdf>.

That is the class file format for Java 5 (Java 6 has another 100 pages
or so of addendum, thanks to a detailed specification of bytecode
verification that is beyond the scope of this post and is pretty much
useless for everyone except compiler and JVM writers); the annotation
information is spread out among several attributes.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top