• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Kind类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.sun.source.doctree.DocTree.Kind的典型用法代码示例。如果您正苦于以下问题:Java Kind类的具体用法?Java Kind怎么用?Java Kind使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Kind类属于com.sun.source.doctree.DocTree包,在下文中一共展示了Kind类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: insideTag

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
private void insideTag(DocTreePath tag, JavadocContext jdctx) {
    switch (tag.getLeaf().getKind()) {
        case IDENTIFIER:
            if (tag.getParentPath() == null || tag.getParentPath().getLeaf().getKind() != Kind.PARAM)
                break;
            tag = tag.getParentPath();
            //intentional fall-through:
        case PARAM:
            insideParamTag(tag, jdctx);
            break;
        case SEE: case THROWS: case VALUE:
        case LINK: case LINK_PLAIN://XXX: was only unclosed???
            insideSeeTag(tag, jdctx);
            break;
        case REFERENCE:
            insideReference(tag, jdctx);
            break;
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:JavadocCompletionQuery.java


示例2: getDocLink

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
public Content getDocLink(LinkInfoImpl.Kind context, TypeElement typeElement, Element element,
        Content label, boolean strong, boolean isProperty) {
    if (! (utils.isIncluded(element) || utils.isLinkable(typeElement))) {
        return label;
    } else if (utils.isExecutableElement(element)) {
        ExecutableElement ee = (ExecutableElement)element;
        return getLink(new LinkInfoImpl(configuration, context, typeElement)
            .label(label)
            .where(getName(getAnchor(ee, isProperty)))
            .strong(strong));
    } else if (utils.isVariableElement(element) || utils.isTypeElement(element)) {
        return getLink(new LinkInfoImpl(configuration, context, typeElement)
            .label(label)
            .where(getName(element.getSimpleName().toString()))
            .strong(strong));
    } else {
        return label;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:HtmlDocletWriter.java


示例3: ignoreNonInlineTag

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
boolean ignoreNonInlineTag(DocTree dtree) {
    Name name = null;
    if (dtree.getKind() == Kind.START_ELEMENT) {
        StartElementTree setree = (StartElementTree)dtree;
        name = setree.getName();
    } else if (dtree.getKind() == Kind.END_ELEMENT) {
        EndElementTree eetree = (EndElementTree)dtree;
        name = eetree.getName();
    }

    if (name != null) {
        com.sun.tools.doclint.HtmlTag htmlTag = com.sun.tools.doclint.HtmlTag.get(name);
        if (htmlTag != null &&
                htmlTag.blockType != com.sun.tools.doclint.HtmlTag.BlockType.INLINE) {
            return true;
        }
    }
    return false;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:HtmlDocletWriter.java


示例4: getInstance

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
/**
 * Construct a new MemberSummaryBuilder for an annotation type.
 *
 * @param annotationTypeWriter the writer for the class whose members are
 *                             being summarized.
 * @param context       the build context.
 * @return              the instance
 */
public static MemberSummaryBuilder getInstance(
        AnnotationTypeWriter annotationTypeWriter, Context context) {
    MemberSummaryBuilder builder = new MemberSummaryBuilder(context,
            annotationTypeWriter.getAnnotationTypeElement()) {
        @Override
        public void build(Content contentTree) {
            buildAnnotationTypeFieldsSummary(contentTree);
            buildAnnotationTypeRequiredMemberSummary(contentTree);
            buildAnnotationTypeOptionalMemberSummary(contentTree);
        }

        @Override
        public boolean hasMembersToDocument() {
            return !utils.getAnnotationMembers(typeElement).isEmpty();
        }
    };
    WriterFactory wf = context.configuration.getWriterFactory();
    for (VisibleMemberMap.Kind kind : VisibleMemberMap.Kind.values()) {
        MemberSummaryWriter msw = builder.getVisibleMemberMap(kind).noVisibleMembers()
                ? null
                : wf.getMemberSummaryWriter(annotationTypeWriter, kind);
        builder.memberSummaryWriters.put(kind, msw);
    }
    return builder;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:34,代码来源:MemberSummaryBuilder.java


示例5: containsParam

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
private boolean containsParam(List<? extends DocTree> blockTags, String name) {
    for (DocTree blockTag : blockTags) {
        if(blockTag.getKind() == Kind.PARAM) {
            ParamTree param = (ParamTree) blockTag;
            if(name.contentEquals(param.getName().getName())) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:12,代码来源:JavadocCompletionQuery.java


示例6: newExceptionTree

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public DCThrows newExceptionTree(ReferenceTree name, List<? extends DocTree> description) {
    // TODO: verify the reference is just to a type (not a field or method)
    DCThrows tree = new DCThrows(Kind.EXCEPTION, (DCReference) name, cast(description));
    tree.pos = pos;
    return tree;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:DocTreeMaker.java


示例7: newThrowsTree

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public DCThrows newThrowsTree(ReferenceTree name, List<? extends DocTree> description) {
    // TODO: verify the reference is just to a type (not a field or method)
    DCThrows tree = new DCThrows(Kind.THROWS, (DCReference) name, cast(description));
    tree.pos = pos;
    return tree;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:DocTreeMaker.java


示例8: addClassesSummary

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
public void addClassesSummary(SortedSet<TypeElement> classes, String label,
        String tableSummary, List<String> tableHeader, Content summaryContentTree) {
    if (!classes.isEmpty()) {
        Content caption = getTableCaption(new RawHtml(label));
        Content table = (configuration.isOutputHtml5())
                ? HtmlTree.TABLE(HtmlStyle.typeSummary, caption)
                : HtmlTree.TABLE(HtmlStyle.typeSummary, tableSummary, caption);
        table.addContent(getSummaryTableHeader(tableHeader, "col"));
        Content tbody = new HtmlTree(HtmlTag.TBODY);
        boolean altColor = true;
        for (TypeElement te : classes) {
            if (!utils.isCoreClass(te) ||
                !configuration.isGeneratedDoc(te)) {
                continue;
            }
            Content classContent = getLink(new LinkInfoImpl(
                    configuration, LinkInfoImpl.Kind.PACKAGE, te));
            Content tdClass = HtmlTree.TH_ROW_SCOPE(HtmlStyle.colFirst, classContent);
            HtmlTree tr = HtmlTree.TR(tdClass);
            tr.addStyle(altColor ? HtmlStyle.altColor : HtmlStyle.rowColor);
            altColor = !altColor;
            HtmlTree tdClassDescription = new HtmlTree(HtmlTag.TD);
            tdClassDescription.addStyle(HtmlStyle.colLast);
            if (utils.isDeprecated(te)) {
                tdClassDescription.addContent(getDeprecatedPhrase(te));
                List<? extends DocTree> tags = utils.getDeprecatedTrees(te);
                if (!tags.isEmpty()) {
                    addSummaryDeprecatedComment(te, tags.get(0), tdClassDescription);
                }
            } else {
                addSummaryComment(te, tdClassDescription);
            }
            tr.addContent(tdClassDescription);
            tbody.addContent(tr);
        }
        table.addContent(tbody);
        summaryContentTree.addContent(table);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:40,代码来源:HtmlDocletWriter.java


示例9: getPreQualifiedClassLink

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
/**
 * Retrieve the class link with the package portion of the label in
 * plain text.  If the qualifier is excluded, it will not be included in the
 * link label.
 *
 * @param typeElement the class to link to.
 * @param isStrong true if the link should be strong.
 * @return the link with the package portion of the label in plain text.
 */
public Content getPreQualifiedClassLink(LinkInfoImpl.Kind context,
        TypeElement typeElement, boolean isStrong) {
    ContentBuilder classlink = new ContentBuilder();
    PackageElement pkg = utils.containingPackage(typeElement);
    if (pkg != null && ! configuration.shouldExcludeQualifier(pkg.getSimpleName().toString())) {
        classlink.addContent(getEnclosingPackageName(typeElement));
    }
    classlink.addContent(getLink(new LinkInfoImpl(configuration,
            context, typeElement).label(utils.getSimpleName(typeElement)).strong(isStrong)));
    return classlink;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:HtmlDocletWriter.java


示例10: addPreQualifiedClassLink

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
/**
 * Add the class link with the package portion of the label in
 * plain text. If the qualifier is excluded, it will not be included in the
 * link label.
 *
 * @param context the id of the context where the link will be added
 * @param typeElement the class to link to
 * @param isStrong true if the link should be strong
 * @param contentTree the content tree to which the link with be added
 */
public void addPreQualifiedClassLink(LinkInfoImpl.Kind context,
        TypeElement typeElement, boolean isStrong, Content contentTree) {
    PackageElement pkg = utils.containingPackage(typeElement);
    if(pkg != null && ! configuration.shouldExcludeQualifier(pkg.getSimpleName().toString())) {
        contentTree.addContent(getEnclosingPackageName(typeElement));
    }
    LinkInfoImpl linkinfo = new LinkInfoImpl(configuration, context, typeElement)
            .label(utils.getSimpleName(typeElement))
            .strong(isStrong);
    Content link = getLink(linkinfo);
    contentTree.addContent(link);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:HtmlDocletWriter.java


示例11: isHidden

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
/**
 * Returns true if the element is included, contains &#64;hidden tag,
 * or if javafx flag is present and element contains &#64;treatAsPrivate
 * tag.
 * @param e the queried element
 * @return true if it exists, false otherwise
 */
public boolean isHidden(Element e) {
    // prevent needless tests on elements which are not included
    if (!isIncluded(e)) {
        return false;
    }
    if (configuration.javafx &&
            hasBlockTag(e, DocTree.Kind.UNKNOWN_BLOCK_TAG, "treatAsPrivate")) {
        return true;
    }
    return hasBlockTag(e, DocTree.Kind.HIDDEN);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:19,代码来源:Utils.java


示例12: shouldDocument

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
private boolean shouldDocument(Element e) {
    if (shouldDocumentVisitor == null) {
        shouldDocumentVisitor = new SimpleElementVisitor9<Boolean, Void>() {
            private boolean hasSource(TypeElement e) {
                return configuration.docEnv.getFileKind(e) ==
                        javax.tools.JavaFileObject.Kind.SOURCE;
            }

            // handle types
            @Override
            public Boolean visitType(TypeElement e, Void p) {
                return configuration.docEnv.isSelected(e) && hasSource(e);
            }

            // handle everything else
            @Override
            protected Boolean defaultAction(Element e, Void p) {
                return configuration.docEnv.isSelected(e);
            }

            @Override
            public Boolean visitUnknown(Element e, Void p) {
                throw new AssertionError("unkown element: " + p);
            }
        };
    }
    return shouldDocumentVisitor.visit(e);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:Utils.java


示例13: filteredList

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
public List<? extends DocTree> filteredList(List<? extends DocTree> dlist, DocTree.Kind... select) {
    List<DocTree> list = new ArrayList<>(dlist.size());
    if (select == null)
        return dlist;
    for (DocTree dt : dlist) {
        if (dt.getKind() != ERRONEOUS) {
            for (DocTree.Kind kind : select) {
                if (dt.getKind() == kind) {
                    list.add(dt);
                }
            }
        }
    }
    return list;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:16,代码来源:Utils.java


示例14: getBlockTags0

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
private List<? extends DocTree> getBlockTags0(Element element, DocTree.Kind... kinds) {
    DocCommentTree dcTree = getDocCommentTree(element);
    if (dcTree == null)
        return Collections.emptyList();

    return filteredList(dcTree.getBlockTags(), kinds);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:Utils.java


示例15: getBlockTags

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
public List<? extends DocTree> getBlockTags(Element element, String tagName) {
    DocTree.Kind kind = null;
    switch (tagName) {
        case "author":
        case "deprecated":
        case "hidden":
        case "param":
        case "return":
        case "see":
        case "serial":
        case "since":
        case "throws":
        case "exception":
        case "version":
            kind = DocTree.Kind.valueOf(tagName.toUpperCase());
            return getBlockTags(element, kind);
        case "serialData":
            kind = SERIAL_DATA;
            return getBlockTags(element, kind);
        case "serialField":
            kind = SERIAL_FIELD;
            return getBlockTags(element, kind);
        default:
            kind = DocTree.Kind.UNKNOWN_BLOCK_TAG;
            break;
    }
    List<? extends DocTree> blockTags = getBlockTags(element, kind);
    List<DocTree> out = new ArrayList<>();
    String tname = tagName.startsWith("@") ? tagName.substring(1) : tagName;
    CommentHelper ch = getCommentHelper(element);
    for (DocTree dt : blockTags) {
        if (ch.getTagName(dt).equals(tname)) {
            out.add(dt);
        }
    }
    return out;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:38,代码来源:Utils.java


示例16: hasBlockTag

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
public boolean hasBlockTag(Element element, DocTree.Kind kind, final String tagName) {
    CommentHelper ch = getCommentHelper(element);
    String tname = tagName != null && tagName.startsWith("@")
            ? tagName.substring(1)
            : tagName;
    for (DocTree dt : getBlockTags(element, kind)) {
        if (dt.getKind() == kind) {
            if (tname == null || ch.getTagName(dt).equals(tname)) {
                return true;
            }
        }
    }
    return false;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:Utils.java


示例17: MemberSummaryBuilder

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
/**
 * Construct a new MemberSummaryBuilder.
 *
 * @param classWriter   the writer for the class whose members are being
 *                      summarized.
 * @param context       the build context.
 */
private MemberSummaryBuilder(Context context, TypeElement typeElement) {
    super(context);
    this.typeElement = typeElement;
    memberSummaryWriters = new EnumMap<>(VisibleMemberMap.Kind.class);

    comparator = utils.makeGeneralPurposeComparator();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:MemberSummaryBuilder.java


示例18: buildEnumConstantsSummary

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
/**
 * Build the summary for the enum constants.
 *
 * @param memberSummaryTree the content tree to which the documentation will be added
 */
protected void buildEnumConstantsSummary(Content memberSummaryTree) {
    MemberSummaryWriter writer =
            memberSummaryWriters.get(VisibleMemberMap.Kind.ENUM_CONSTANTS);
    VisibleMemberMap visibleMemberMap =
            getVisibleMemberMap(VisibleMemberMap.Kind.ENUM_CONSTANTS);
    addSummary(writer, visibleMemberMap, false, memberSummaryTree);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:MemberSummaryBuilder.java


示例19: buildAnnotationTypeFieldsSummary

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
/**
 * Build the summary for fields.
 *
 * @param memberSummaryTree the content tree to which the documentation will be added
 */
protected void buildAnnotationTypeFieldsSummary(Content memberSummaryTree) {
    MemberSummaryWriter writer =
            memberSummaryWriters.get(VisibleMemberMap.Kind.ANNOTATION_TYPE_FIELDS);
    VisibleMemberMap visibleMemberMap =
            getVisibleMemberMap(VisibleMemberMap.Kind.ANNOTATION_TYPE_FIELDS);
    addSummary(writer, visibleMemberMap, false, memberSummaryTree);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:MemberSummaryBuilder.java


示例20: buildAnnotationTypeOptionalMemberSummary

import com.sun.source.doctree.DocTree.Kind; //导入依赖的package包/类
/**
 * Build the summary for the optional members.
 *
 * @param memberSummaryTree the content tree to which the documentation will be added
 */
protected void buildAnnotationTypeOptionalMemberSummary(Content memberSummaryTree) {
    MemberSummaryWriter writer =
            memberSummaryWriters.get(VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_OPTIONAL);
    VisibleMemberMap visibleMemberMap =
            getVisibleMemberMap(VisibleMemberMap.Kind.ANNOTATION_TYPE_MEMBER_OPTIONAL);
    addSummary(writer, visibleMemberMap, false, memberSummaryTree);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:MemberSummaryBuilder.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ArrowLocation类代码示例发布时间:2022-05-22
下一篇:
Java InstantiatorStrategy类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap