JDK-4862403 : RFE: meta model management / meta model programming
  • Type: Enhancement
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 1.4.2
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-05-12
  • Updated: 2003-05-16
  • Resolved: 2003-05-16
Related Reports
Duplicate :  
Description

Name: rmT116609			Date: 05/12/2003


A DESCRIPTION OF THE REQUEST :
An application look for some description on source (do NOT mean reflection). Most of them are in the class (for example : tag in javadoc, inheritance, field, method signature) but some need to go deep inside the body of method.

The problem is that no java class define the internal part of a method. The following entities:
��	Class Field Package Method Constructor ? exist for reflection and do not suit because it works on byte code and not on source.
��	ClassDoc FieldDoc PackageDoc MethodDoc ConstructorDoc ? exist but there?re no Statement, Expression ?
In fact not all entities are define in the grammar of the java language definition (chapter 18).

Doclet provide the information to describe the java language but it cannot go deep in the method body. Some project provide all facilities to handle this (they can also perform modification), for example the Together from Borland http://community.togethersoft.com/docs/5.5/Users_Guide/Together_Open_API.htm
or a open source project named Recoder.
http://recoder.sourceforge.net/index.html
Another solution consist to parse the java language grammar with a tools like javacc, but it's a more long term job.



JUSTIFICATION :
I'll used to work with together open api and I plan to get an open source tools. But the api are not compatible. Restarting from scratch will get me a lot of work and also put me in the same trouble in the future. The java language should be describe with itself. Some doclet interface should be added according to the specification and then all metamodel programming can be easily  changed (like JDO helps the database handling).
I spent time on JSR to see if such feature is about to come but ?
JSR175 (Metadata) and JSR199 (javax.compiler) are in the same guideline so I think it's a good idea.


EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
��	Add interface in the doclet API to handle all entities define in the java language grammar (at least it should be only to describe source. Modifying is a little bit more difficult).
��	At first those entities should be interface to help delegation and inheritance (factory should be present for convenience use)
��	Domain exception should be associate
��	Doclet tools should handle those new interface
(Review ID: 185632) 
======================================================================