3.6. Package Reflection

Most of the Reflection API deals with class-level metadata. However, version information is another form of metadata, and it plays a critical role as code evolves; it makes sure that client code accesses only compatible versions of needed classes. Version metadata is also useful when you need to know the exact version of software that caused a problem. In Java, version information is typically tracked at the level of a package, and it is stored at the level of the JAR file. This is reasonable because the next smaller unit, the class file, is typically too small to be the standard unit of versioning or deployment. Version information is embedded in JAR files, added to the virtual machine by a class loader, and accessed ...

Get Component Development for the Java™ Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.