{@inheritDoc} not inheriting superclass javadoc in Eclipse

别说谁变了你拦得住时间么 提交于 2019-12-04 20:45:33

问题


When I use {@inheritDoc} in Eclipse, the superclass's javadoc comments are not appearing in my class's javadoc.

I have the following piece of code:

import javax.swing.table.AbstractTableModel;

public class TestTableModel extends AbstractTableModel {

/**
 * {@inheritDoc}
 */
@Override
public int getRowCount() {
    return 1;
}

@Override
public Object getValueAt(int rowIndex, int columnIndex) {
    return null;
}

@Override
public int getColumnCount() {
    return 0;
}
}

I make sure that rt.jar library (which contains javax.swing.table.AbstractTableModel) has source code and javadoc locations set, and indeed when I hover over getRowCount() I get the AbstractTableModel javadoc in a tool tip. When I generate the javadoc from Eclipse, I make sure that in the "referenced archives and projects" section that rt.jar is selected. But the inherit doc does not work.


回答1:


It looks like the superclass's source (in this case AbstractTableModel.java) must be on the sourcepath of javadoc. This is done in Eclipse by creating a project for AbstractTableModel and selecting it in the "Select types for which Javadoc will be generated" selection during javadoc generation.



来源:https://stackoverflow.com/questions/1243063/inheritdoc-not-inheriting-superclass-javadoc-in-eclipse

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!