Serge
Serge

Reputation: 626

Finding implementations of an interface in Eclipse

I'm looking at the following method.

public void setRecordValidator(Validator recordValidator) {
    this.recordValidator = recordValidator;
}

In this case class Validator is an interface. I'm not sure what kind of object to pass on to the method since I'm not sure what classes actually implement Validator.

The question is how can I view classes that implement Validator in Eclipse?

Upvotes: 3

Views: 655

Answers (5)

matteo rulli
matteo rulli

Reputation: 1493

Select Validator in

 public void setRecordValidator(Validator recordValidator) {
    this.recordValidator = recordValidator;
 }

and press F4 key.

Upvotes: 1

M Abbas
M Abbas

Reputation: 6479

Open the interface then select search -> implementers-> Select Project

enter image description here

Or Select the interface name then ctrl + T

enter image description here

Upvotes: 2

JonK
JonK

Reputation: 2108

There's a few ways to get this information, here are some of them:

Right click on the name of the interface and select Open Type Hierarchy (the shortcut for this is F4 by default).

Alternatively, you could right click it and choose References > Hierarchy instead.

CTRL+T will give you a Javadoc-style popup with the type hierarchy inside.

There are plenty of other ways to do this, so pick your poison really.

Upvotes: 2

Michał Kosmulski
Michał Kosmulski

Reputation: 10020

Click on Validator somewhere in the code and press Ctrl+T - this will open the Type Hierarchy popup.

Upvotes: 4

Jeroen Vannevel
Jeroen Vannevel

Reputation: 44439

Rightclick on Validator -> Declarations -> Project

Rightclick on Validator in the search result -> Implementations -> Project

Upvotes: 3

Related Questions