JDK-4636466 : Java Language Metadata (Annotation)
  • Type: Enhancement
  • Component: specification
  • Sub-Component: language
  • Affected Version: 1.4.1,5.0
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic,solaris_9
  • CPU: generic,sparc
  • Submitted: 2002-02-12
  • Updated: 2006-07-13
  • Resolved: 2006-07-13
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0 tigerFixed
Related Reports
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
Name: jb33418			Date: 02/11/2002



Within the Java platform there has been a growing trend towards marking fields,
or methods, or classes as having particular characteristics that indicate they
should be processed in special ways by development tools, or deployment tools,
or run-time libraries.

For example, the JavaBeans 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, etc. Similarly the Enterprise JavaBeans architecture introduced
various stylistic patterns that allow methods to be marked as remote methods,
home methods, etc. In addition, the EJB architecture defined significant extra
information in its deployment descriptors that is used to provide information
on things like the persistence relationships of fields, or the transaction
properties of methods, etc.  Many other areas could benefit from this work,
including component architectures and testing platforms.

In general, the desire to provide various kinds of auxiliary information for
Java elements appears to be growing. While the existing mechanisms have been
adequate for simple uses, they are becoming increasingly awkward for more
complicated uses.

Since there seems to be a recurrent need to be able to provide auxiliary
information on Java language elements, it appears to be appropriate to define
an explicit way of doing this in the Java language, to allow arbitrary
attribute information to be associated with particular
classes/interfaces/methods/fields. We refer to this mechanism as "Java language
metadata".

We believe there are several elements needed as part of this work:

Definition of a Java language extension that allows metadata information to
be supplied for (at least) classes, interfaces, methods, and fields. This
language extension will allow metadata to be recognized by development tools.
It appears likely that it will be useful to allow attribute values to be
associated with given metadata attributes.
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
javadoc tag "@meta" or adding a new Java language keyword "meta".

Definition of a runtime delivery format for metadata and of runtime APIs so
that tools and libraries can access metadata information at deployment time
and at runtime.

Definition of rules for the attribute namespace so as to avoid accidental
collisions over the same attribute name. Details will be determined by the
expert group, but it seems that a mechanism similar to the Java class naming
conventions might be useful.

======================================================================

Comments
EVALUATION Annotations were added to Tiger (jdk5.0) under JSR-175: http://jcp.org/en/jsr/detail?id=175 A complete description of this language feature may be found in the Java Language Specification, Third Edition. Annotations are covered in section 9.6 "Annotation Types" and section 9.7 "Annotations" http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html http://java.sun.com/docs/books/jls/third_edition/html/interfaces.html#9.6 http://java.sun.com/docs/books/jls/third_edition/html/interfaces.html#9.7
13-07-2006

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger
04-08-2004

PUBLIC COMMENTS ...
04-08-2004

EVALUATION Name: jb33418 Date: 02/11/2002 This feature has been added for Tiger release ====================================================================== We expect to have a first implementation in Tiger in August. ###@###.### 2003-07-30
30-07-2003