Вопрос

I have this super class which extends from another class

public abstract class AbstractDOEMessageFinderAction extends BasicObjectFinder {

    public Object performBasicSearch() {

        // works fine because getQuery is defined in BasicObjectFinder
        return getQuery(); 
    }

The other class is ISIRFinderAction which extends from AbstractDOEMessageDashboardAction

ISIRFinderAction extends AbstractDOEMessageDashboardAction {

    // My aim is to make sure this method works so that I will make
    // the super class's performBasicSearch() method abstract.

    public Object performBasicSearch() {

        // this one doesnt even compile but it extends AbstractDOEMessageDashboardAction
        // which in turn extends BasicObjectFinder
        return getQuery();

    }

}

Am I missing something? Why is getQuery not working. I thought it would search it in the class hierarchy.

Это было полезно?

Решение

The second class extends AbstractDOEMessageDashboardAction not AbstractDOEMessageFinderAction.

Другие советы

Does AbstractDOEMessageDashboardAction also extend BasicObjectFinder?

(Note, AbstractDOEMessageDashboardAction is ofcourse not the same as AbstractDOEMessageFinderAction).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top