本文整理汇总了Java中com.sun.source.doctree.ReferenceTree.getSignature方法的典型用法代码示例。如果您正苦于以下问题:Java ReferenceTree.getSignature方法的具体用法?Java ReferenceTree.getSignature怎么用?Java ReferenceTree.getSignature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.source.doctree.ReferenceTree
的用法示例。
在下文中一共展示了ReferenceTree.getSignature方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkReference
import com.sun.source.doctree.ReferenceTree; //导入方法依赖的package包/类
void checkReference(ReferenceTree tree, List<? extends DocTree> label) {
String sig = tree.getSignature();
Element found = trees.getElement(new DocTreePath(getCurrentPath(), tree));
if (found == null) {
System.err.println(sig + " NOT FOUND");
} else {
System.err.println(sig + " found " + found.getKind() + " " + found);
}
String expect = "UNKNOWN";
if (label.size() > 0 && label.get(0) instanceof TextTree)
expect = ((TextTree) label.get(0)).getBody();
if (!expect.equalsIgnoreCase(found == null ? "bad" : found.getKind().name())) {
error(tree, "Unexpected value found: " + found +", expected: " + expect);
}
}
示例2: appendReference
import com.sun.source.doctree.ReferenceTree; //导入方法依赖的package包/类
private void appendReference(StringBuilder sb, ReferenceTree ref, List<? extends DocTree> label, TreePath docPath, DocCommentTree doc, DocTrees trees) {
String sig = ref.getSignature();
if (sig != null && sig.length() > 0) {
if (sig.charAt(0) == '#') { //NOI18N
sig = sig.substring(1);
}
sig = sig.replace('#', '.'); //NOI18N
}
Element element = trees.getElement(DocTreePath.getPath(docPath, doc, ref));
if (element != null) {
createLink(sb, element, label == null || label.isEmpty() ? sig : inlineTags(label, docPath, doc, trees, null)); //NOI18N
} else {
sb.append(label == null || label.isEmpty() ? sig : inlineTags(label, docPath, doc, trees, null));
}
}
示例3: visitReference
import com.sun.source.doctree.ReferenceTree; //导入方法依赖的package包/类
@Override
public Void visitReference(ReferenceTree tree, Void ignore) {
String sig = tree.getSignature();
if (sig.contains("<") || sig.contains(">"))
env.messages.error(REFERENCE, tree, "dc.type.arg.not.allowed");
Element e = env.trees.getElement(getCurrentPath());
if (e == null)
env.messages.error(REFERENCE, tree, "dc.ref.not.found");
return super.visitReference(tree, ignore);
}
示例4: visitReference
import com.sun.source.doctree.ReferenceTree; //导入方法依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public Void visitReference(ReferenceTree tree, Void ignore) {
String sig = tree.getSignature();
if (sig.contains("<") || sig.contains(">"))
env.messages.error(REFERENCE, tree, "dc.type.arg.not.allowed");
Element e = env.trees.getElement(getCurrentPath());
if (e == null)
env.messages.error(REFERENCE, tree, "dc.ref.not.found");
return super.visitReference(tree, ignore);
}