Updates to the Original Java Specification Request (JSR)
The following updates have been made to the original JSR.
2010年02月15日:
Maintenance Lead: Alex Buckley, Oracle
E-Mail Address: alex.buckley@oracle.com
Telephone Number: +1 408 276 3065
2006年11月02日:
Maintenance Lead: (削除) Danny Coward (削除ここまで)
E-Mail Address: (削除) danny.coward@sun.com (削除ここまで)
Telephone Number: (削除) +1 408 276 7049 (削除ここまで)
Fax Number: (削除) +1 408 276 7700 (削除ここまで)
It is intended that this JSR will be delivered as part of the J2SETM "Tiger" release.
Identification |
Request |
Contributions
Section 1. Identification
Submitting Member: Sun Microsystems, Inc.
Name of Contact Person: Joshua Bloch
E-Mail Address: joshua.bloch@sun.com
Telephone Number: +1 408 276 7022
Fax Number:
Specification Lead: Joshua Bloch
E-Mail Address: joshua.bloch@sun.com
Telephone Number: +1 408 276 7022
Fax Number:
Initial Expert Group Membership:
Supporting this JSR:
BEA Systems
Borland Software Corporation
Oracle Corporation
Sun Microsystems, Inc.
Section 2: Request
There has been a growing trend towards annotating fields, methods, and classes as having particular attributes that indicate they should be processed in special ways by development tools, deployment tools, or run-time libraries. We call such annotations metadata.
For example, the JavaBeansTM architecture introduced various stylistic naming patterns (such as getFoo/setFoo method names) that could be used to indicate that particular methods were used for accessing properties, for registering event handlers, and so forth. Similarly the Enterprise JavaBeans architecture introduced various stylistic patterns that allow methods to be marked as remote methods, home methods, and the like. The EJB architecture defines significant extra information in its deployment descriptors that is used to provide information on things like the persistence relationships of fields, the transactional properties of methods, and so forth. Source code defining web services components has similar needs.
Custom tools may use metdata to generate auxillary source files to be used in conjunction with the source file containing the annotation. For example, a stub generator could generate remote procedure call stubs based on annotations indicating that certain methods are designed for remote use.
In general, the need to provide auxiliary information for program elements appears to be growing. While the existing mechanisms have been adequate for simple uses, they are becoming increasingly awkward for more complicated uses. In light of this situation, it seems appropriate to add to the Java programming language a means of associating arbitrary attribute information with particular classes/interfaces/methods/fields. We refer to this mechanism as the Java programming language metadata facility. This facility is meant to replace the various ad hoc metadata facilities in use today.
We believe there are several elements needed as part of this JSR:
The exact syntax will need to be determined by the expert group. There appear to be a number of possibilities, including (but not limited to!) using a doc comment tag @meta or adding a new Java programming language keyword meta.
This list is not meant to be exhaustive. For example, if it is determined that there is a need for the compiler to do some validity checking on metadata, we will need a mechanism for communicating restrictions on the use of a particular attribute (such as "The attribute com.acme.Remote may be used on methods, but not on classes, interfaces, or fields"). Metadata processing tools such as stub generators, however, are outside the scope of this JSR. The JSR is intended to enable such tools, but not to define them.
Java 2, Standard Edition.
As described above, this specification will make it easier to provide auxiliary information for classes, interfaces, fields, and methods.
There is no existing language mechanism for providing this kind of information.
A Java programming language feature for metadata, plus a runtime format for metadata information, plus runtime APIs for accessing metadata information.
No
No
No
No
No existing mechanisms will be altered or deprecated. However, it is anticipated that some specifications (such as the EJB or JAX-RPC specifications) may make use of this feature in future revisions.
TBD
Note that this section has been updated since the original JSR.
It is anticipated that most of the work will be done by email with occasional teleconferences and perhaps face-to-face meetings where appropriate.
Section 3: Contributions
The JavaTM Language Specification.
The existing JavaTM Language Specification will be used as the basis for this work, and will be amended to include any language changes that results from this effort.