5.5. Reading Custom Metadata

The Java binary class format provides a standard set of extensions for adding custom data to binary classes. However, to take advantage of any custom class data at runtime, you must write a custom class loader that is aware of your extensions to the class format. In this section, you will see a custom extension to the class format that includes extra version information, and you will see a custom class loader that uses this information to locate the correct versions of classes that it will load.

Before you jump into the example or apply this technique in your own code, you need to be very careful that your additions to the class do not violate the Java license agreement. You cannot create modified classes that require ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.