Jim L.
Jim L.

Reputation: 6529

How To Find All Methods Returning Type in Javadoc?

I am using a large and unfamiliar API and would like to find all the ways of obtaining a particular class or interface. Is there a way in Javadocs to find all the methods that return such a type? If not, what are some good ways? (I'm using IntelliJ.)

Upvotes: 3

Views: 869

Answers (3)

fge
fge

Reputation: 121730

In the standard Javadoc layout, you cannot do that specifically.

However, you can find all usages of a particular class, provided you are on the javadoc page for that class: at the top of the page, you have a set of links; one of them is called Use (it's right next to Class). It will indeed list all the uses of that class, whether it be as a return value or as an argument.

In IDEA itself, if you have the cursor on the class you want, you can press Alt+F7, you'll have the option to search for the uses of a particular class in your project, or your project PLUS the libraries you depend upon.

Upvotes: 4

aperez
aperez

Reputation: 21

If you are using IntelliJ, for finding a particular Class, you can use Ctrl+N to find any class you have in your project. To find all methods that return a type, I would go with Find Usages option, Alt+F7. You can refine your results afterward.

Additionally, if you have a lengthy class open in your editor, you can use Ctrl-F12 to open the File Structure view. Start typing the returning type you are looking for, you will get a shorter list of potential methods you want.

Upvotes: 2

Patrick Chan
Patrick Chan

Reputation: 1029

Other than javadoc, you can get the return type of all methods of a specific class by Reflection.

Upvotes: -2

Related Questions