Skip to main content
U.S. Department of Energy
Office of Scientific and Technical Information

Java Metadata Facility

Journal Article · · Encyclopedia of Database Systems, N/A, N/A, November 1, 2009, pp. 1580
OSTI ID:973644
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 {at} 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; and (6) The return type of methods of an annotation type must be a primitive, a String, a Class, an annotation type, or an array, where the type of the array is restricted to one of the four allowed types. See [2] for additional restrictions and syntax. The methods of an annotation type define the elements that may be used to parameterize the annotation in code. Annotation types may have default values for any of its elements. For example, an annotation that specifies a defect report could initialize an element defining the defect outcome submitted. Annotations may also have zero elements. This could be used to indicate serializability for a class (as opposed to the current Serializability interface).
Research Organization:
Lawrence Livermore National Laboratory (LLNL), Livermore, CA
Sponsoring Organization:
USDOE
DOE Contract Number:
W-7405-ENG-48
OSTI ID:
973644
Report Number(s):
LLNL-JRNL-402071
Journal Information:
Encyclopedia of Database Systems, N/A, N/A, November 1, 2009, pp. 1580, Journal Name: Encyclopedia of Database Systems, N/A, N/A, November 1, 2009, pp. 1580
Country of Publication:
United States
Language:
English

Similar Records

Jess, the Java expert system shell
Technical Report · Fri Oct 31 23:00:00 EST 1997 · OSTI ID:565603

The CERN PS/SL Controls Java Application Programming Interface
Conference · Fri Oct 01 00:00:00 EDT 1999 · OSTI ID:775627

EPICS : Extensible record and device support.
Conference · Mon Nov 17 23:00:00 EST 1997 · OSTI ID:8887