Skip to main content

Java Metadata Facility

  • Reference work entry
  • First Online:
  • 23 Accesses

Synonyms

Java annotations; Java metadata facility; JSR 175

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. 1.

    They cannot be generic.

  2. 2.

    They cannot extend other annotation types or interfaces.

  3. 3.

    Methods cannot have any parameters.

  4. 4.

    Methods cannot have type parameters.

  5. 5.

    Methods cannot throw exceptions.

  6. 6.

    The return type of methods of an annotation type must...

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   4,499.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Hardcover Book
USD   6,499.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Recommended Reading

  1. Coward D. JSR 175: a metadata facility for the Java™ Programming Language, 2004. http://jcp.org/en/jsr/detail?id=175

  2. Gosling J, Joy B, Steele G, Bracha G. The Java™ language specification. Englewood Cliffs: Prentice Hall; 2005.

    MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to David J. Buttler .

Editor information

Editors and Affiliations

Section Editor information

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Science+Business Media, LLC, part of Springer Nature

About this entry

Check for updates. Verify currency and authenticity via CrossMark

Cite this entry

Buttler, D.J. (2018). Java Metadata Facility. In: Liu, L., Özsu, M.T. (eds) Encyclopedia of Database Systems. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-8265-9_910

Download citation

Publish with us

Policies and ethics