Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7745607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T10:03:53+00:00 2026-06-01T10:03:53+00:00

I am writing a tool to scrape Javadoc from pre-existing Java source files and

  • 0

I am writing a tool to scrape Javadoc from pre-existing Java source files and preprocess it via a custom doclet (the specifics of the processing are not relevant). I have written the doclet, and I’m able to invoke the doclet from my code via the programmatic API as indicated in the Java documentation.

It appears that this mechanism is “write-only” in the sense that the results of running the doclet, if any, cannot be transmitted back to the invoker of the execute() method through a first class Java object. Instead, I have to resort to a kludge such as writing intermediate output to a file from within the doclet and then reading that back in from my caller.

So my question: is there any way to retrieve, say, a String generated by my custom doclet directly at the invoker? For eg:

public void foo() {
    // Invoke my custom doclet via Javadoc programmatically
    com.sun.tools.javadoc.Main.execute(new String[] {"-d", "docs", "- sourcepath", "/home/usr/src", "p1", "p2"});

    // Access the String output of my doclet here
    String processedJavadoc = getTheOutputOfMyDoclet();
}

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T10:03:54+00:00Added an answer on June 1, 2026 at 10:03 am

    Ok, so the most elegant way I could come up with to do this is to make the doclet class use a static member variable that is set to the RootDoc instance passed in by the Javadoc harness when it invokes the doclet’s start() method, and then allow access to the caller to this static member via a getter. This comes with the obvious thread safety issues of using a static member, but it has worked ok for my purposes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing a tool to automatically generate .egg files from python projects. The tool
I'm writing a simple tool in Qt which reads data from two GPX (XML)
just writing a tool (c# .Net 4) to convert an existing Access 2010 database
I'm writing a tool in Java which does a little drawing on a Graphics
I'm writing a tool that performs copying from USB devices to the local HD
I'm writing a Java tool to validate SQL statements. For SELECT queries, I can
I am currently re-writing an existing tool in PHP that another person started for
I'm currently writing a tool to plug into an existing enterprise application that uses
I am writing a tool for inspecting MP4 files (aka ISO base media file
I'm writing a tool the retrieves data from an Oracle database. The majority of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.