查找从ReferenceTree引用的元素

时间:2019-01-02 23:52:43

标签: java javadoc maven-javadoc-plugin java-11

我正在实现com.sun.source.doctree.DocTreeVisitor,当访问链接时,例如在此方法上,我想做一些特别的事情:

public Void visitLink(LinkTree node, Void o) {
}

LinkTree可以得到一个ReferenceTree,但是我不知道如何找到实际引用的Element

我注意到实际的实现DCReference具有以下注释:

// The following are not directly exposed through ReferenceTree
// use DocTrees.getElement(DocTreePath)
public final JCTree qualifierExpression;
public final Name memberName;
public final List<JCTree> paramTypes;

但是我没有引用元素的DocTreePath

0 个答案:

没有答案