Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-dev] Retrieve javadoc programmatically

Hello Christian,

The code that is responsible for parsing source files and producing Javadoc in HTML format resides in org.eclipse.jdt.ui bundle. But this is a UI feature and heavily depends on other Eclipse UI components. There are some thoughts to isolate the non UI code, but then that's all just thoughts as of now.

Regards,
Jay

Inactive hide details for Christian Pontesegger ---09/10/2015 01:14:28 AM---Thanks for the hint, Jay. your proposal could work Christian Pontesegger ---09/10/2015 01:14:28 AM---Thanks for the hint, Jay. your proposal could work for workspace files. In my case I would like to

From: Christian Pontesegger <christian.pontesegger@xxxxxx>
To: jdt-dev@xxxxxxxxxxx
Date: 09/10/2015 01:14 AM
Subject: Re: [jdt-dev] Retrieve javadoc programmatically
Sent by: jdt-dev-bounces@xxxxxxxxxxx





Thanks for the hint, Jay.

your proposal could work for workspace files. In my case I would like to display javadoc for the java class library and for loaded OSGI bundles. So I am looking for something that parses the src.zip of the JDK and plugin jars/folders that contain source. Alternatively I would love to display docs loaded from JavaDoc pages, either from the web or from the internal eclipse documentation.

The focus of EASE is to script everything available on the currently running JRE, so I want to display as many information on existing classes as possible. Everything in the workspace is not relevant as it typically is not available in the running JRE. But keep those ideas coming :)

The API available is definitely internal, but as a first step the feasibility would be sufficient. As a next step I would come back to the JDT team to see how we could make the API public.

With all the new languages around that run on the JRE it might be interesting to reuse the JavaDocs eg for Groovy or JRuby integration, too.

Christian

Am 08.09.2015 um 07:01 schrieb Jayaprakash Arthanareeswaran:

    Hello Christian,

    If it is only the Javadoc you are interested in, you can get the ICompilationUnit by writing something like this:

       (ICompilationUnit)JavaCore.
    create(getFile(path))

    Once you have the CU, you can work your way through to get the element (method, field etc.) you are interested in and use the following API to get the Javadoc:


        IJavaElement#getAttachedJavadoc()


    Only problem with the above is, it works well for Javadoc attached as HTML, but for source, it only returns what's in the source. That's why you are perhaps using the ProposalInfo, which takes help from JavadocContentAccess2 in converting the Javadoc String to nice HTML format.


    Perhaps someone from the JDT/UI can comment on your usage. But to me looks like you are using code internal to JDT.
    _______________________________________________
    jdt-dev mailing list
    jdt-dev@xxxxxxxxxxx
    To change your delivery options, retrieve your password, or unsubscribe from this list, visit
    https://dev.eclipse.org/mailman/listinfo/jdt-dev

GIF image


Back to the top