当前位置: 首页>>代码示例>>Java>>正文


Java ReferenceTree.getSignature方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:ReferenceTest.java

示例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));
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:ElementJavadoc.java

示例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);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:12,代码来源:Checker.java

示例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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:12,代码来源:Checker.java


注:本文中的com.sun.source.doctree.ReferenceTree.getSignature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。