Adding Annotations

A very useful part of Java is its support for annotations, which are used to define what is sometimes referred to as metadata. To understand what benefits this feature provides, it’s helpful to first realize that the definition of metadata is “data about data.” In other words, metadata is information that describes other data. An example of where metadata has long been used in Java is the java.sql package that contains DatabaseMetaData, ResultSetMetaData, and the relatively new ParameterMetaData interfaces. As implied by the definition just mentioned and by their names, these classes encapsulate data that describes ...

Get Pro Java 8 Programming, Third Edition now with O’Reilly online learning.

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