Synonyms
Definition
The Java Metadata Facility is introduced by Java Specification Request (JSR) 175 [1], and incorporated into the Java language specification [2] in version 1.5 of the language. The specification allows annotations on Java program elements: classes, interfaces, methods, and fields. Annotations give programmers a uniform way to add metadata to program elements that can be used by code checkers, code generators, or other compile-time or runtime components.
Annotations are defined by annotation types. These are defined the same way as interfaces, but with the symbol “@”; preceding the “interface” keyword. There are additional restrictions on defining annotation types:
- 1.
They cannot be generic.
- 2.
They cannot extend other annotation types or interfaces.
- 3.
Methods cannot have any parameters.
- 4.
Methods cannot have type parameters.
- 5.
Methods cannot throw exceptions.
- 6.
The return type of methods of an annotation type must...
Recommended Reading
Coward D. JSR 175: a metadata facility for the Java™ Programming Language, 2004. http://jcp.org/en/jsr/detail?id=175
Gosling J, Joy B, Steele G, Bracha G. The Java™ language specification. Englewood Cliffs: Prentice Hall; 2005.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Section Editor information
Rights and permissions
Copyright information
© 2016 Springer Science+Business Media LLC
About this entry
Cite this entry
Buttler, D.J. (2016). Java Metadata Facility. In: Liu, L., Özsu, M. (eds) Encyclopedia of Database Systems. Springer, New York, NY. https://doi.org/10.1007/978-1-4899-7993-3_910-2
Download citation
DOI: https://doi.org/10.1007/978-1-4899-7993-3_910-2
Received:
Accepted:
Published:
Publisher Name: Springer, New York, NY
Online ISBN: 978-1-4899-7993-3
eBook Packages: Springer Reference Computer SciencesReference Module Computer Science and Engineering