stackoverflowuser2010
stackoverflowuser2010

Reputation: 40969

How do I hide main() from Javadoc documentation?

Every single Java class I write has a main() method for me to run command-line tests. However, I don't want main() to show up in generated Javadoc documentation (which I produce from running javadoc at the command-line). Does anyone know how I can have the main() method omitted from the Javadocs?

Upvotes: 1

Views: 1245

Answers (3)

pb2q
pb2q

Reputation: 59627

I believe there's still no way to prevent parsing/inclusion of particular public members (like main).

See this FAQ: an @exclude directove was being considered at one point.

Upvotes: 1

Eli Turchinsky
Eli Turchinsky

Reputation: 331

The official javadoc FAQ says:

There is currently no Javadoc option to hide, exclude or suppress public members from the javadoc-generated documentation.

But several indirect options are given...

Upvotes: 1

irreputable
irreputable

Reputation: 45443

public class Foo
{
    static class Main
    {
        public static void main(String[] args)
        {
            System.out.println("main");
        }
    }
}

oddly, though Foo&Main isn't public, cmd line java doesn't seem to mind

Upvotes: 1

Related Questions