United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-1242492 : stddoclet: Add links to source code, using -src option

Details
Type:
Enhancement
Submit Date:
1996-03-17
Status:
Closed
Updated Date:
2014-05-05
Project Name:
JDK
Resolved Date:
2001-07-13
Component:
tools
OS:
solaris_2.4,windows_nt,generic
Sub-Component:
javadoc(tool)
CPU:
x86,sparc,generic
Priority:
P5
Resolution:
Fixed
Affected Versions:
1.0,1.2.0,1.2.2,1.3.0
Fixed Versions:
1.4.0 (beta2)

Related Reports
Duplicate:
Duplicate:
Duplicate:
Duplicate:

Sub Tasks

Description
javadoc needs an option that will take and make a link from the method name
to the Source file where that method is defined. With this a VERY NICE source
brouser could be available through the standard documentation program
(javadoc).

Example:

...

Where the only difference is the  
'<a href="src.java.awt.Label.html#getAlignment()">SRC</a>'

and the creation of the src.java.awt.Label.html file with the appropriate <a name=> tags.

                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
merlin-beta2

FIXED IN:
merlin-beta2

INTEGRATED IN:
merlin-beta2

VERIFIED IN:
merlin-beta3


                                     
2004-06-14
PUBLIC COMMENTS

javadoc needs an option that will take and make a link from the method name
to the Source file where that method is defined. With this a VERY NICE source
brouser could be available through the standard documentation program
(javadoc).

=====

This RFE has been implemented.  When -src is used, the doclet generates links from classes and members to the appropriate locations in the source code.  A very simple .java to .html converter has been added to com.sun.tools.doclets.  In the near future, this converter will be improved.


jamie.ho@Eng 2001-06-20

-src has been renamed as -linksource.
###@###.### 2001-10-18
                                     
2001-06-20
EVALUATION

This requires three features:
- Add a -src option to javadoc, which specifies the path to the source code.
- Write a converter to convert .java files to .html files with the required
  <a name="xxx"></a> tags.
- Add capability within templates to insert <a href="yyy.html#xxx">method</a>

I feel this is important and do-able in 1.2 timeframe.  It would be a shame
not to include this, since we include the source code.
doug.kramer@Eng 1997-10-06

On Feb 17, 1998, the TRC (Josh Bloch, Mark Reinhold, Bill Shannon) decided 
that we would not implement this as part of the standard doclet, because it 
would encourage too much dependence on the source code.
doug.kramer@Eng 1998-03-31

I agree completely that the API docs should not include the source.  However,
there are legitimate reason to want to view source (eg. you are developing it).
This is one of the most requested additions to javadoc - I am reopening this
RFE because this capability would allow a quite reasonable poor man's source
browser.  Of course, now with Doclets, a user could do this themselves.
robert.field@Eng 1998-09-09

Source file, line, and column are being added to the javadoc API.
That should be enough to allow the standard doclet to do what is
requested.

The simplest way to do it would be to simply link directly to the
raw source file (possibly preceded by a user-speficied base path).

neal.gafter@Eng 2001-03-29

Location of fix:

SourceToHTMLConverter.java
Configuration.java
MethodSubWriter.java
ClassWriter.java
FieldSubWriter.java
standard.properties

jamie.ho@Eng 2001-06-20

-src has been renamed as -linksource (Fix for 4489854).
Verified for -linksource.
###@###.### 2001-10-18
                                     
2001-06-20



Hardware and Software, Engineered to Work Together