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


Java ListBuffer.appendList方法代码示例

本文整理汇总了Java中com.sun.tools.javac.util.ListBuffer.appendList方法的典型用法代码示例。如果您正苦于以下问题:Java ListBuffer.appendList方法的具体用法?Java ListBuffer.appendList怎么用?Java ListBuffer.appendList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.sun.tools.javac.util.ListBuffer的用法示例。


在下文中一共展示了ListBuffer.appendList方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: processTopLevel

import com.sun.tools.javac.util.ListBuffer; //导入方法依赖的package包/类
void processTopLevel(Element tlTag) {
    String kind = tlTag.getTagName();

    if (kind.equals("annodecl")) {
        // decls stored separately, does not affect bases
        String declId = tlTag.getAttribute("id");
        if (!declId.startsWith("@"))
            declId = "@" + declId;
        idAnnos.put(declId, processAnnoDecl(tlTag));
        return;
    }

    ListBuffer<JCTree>[] bases = processBases(tlTag, null);

    for (JCTree base : bases[0]) { // [0] - bases namely
        JCPackageDecl pkg = make.PackageDecl(
                                List.<JCAnnotation>nil(),
                                make.QualIdent(
                                    new Symbol.PackageSymbol(
                                        names.fromString(packageName),
                                        null)));
        ListBuffer<JCTree> topLevelParts = new ListBuffer<>();
        topLevelParts.append(pkg);
        topLevelParts.appendList(bases[1]); // [1] imports
        topLevelParts.append(base);

        JCCompilationUnit topLevel = make.TopLevel(topLevelParts.toList());
        documentifier.documentify(topLevel, fx);
        topLevels.add(topLevel);
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:32,代码来源:PackageGenerator.java

示例2: processMembers

import com.sun.tools.javac.util.ListBuffer; //导入方法依赖的package包/类
ListBuffer<JCTree> processMembers(Element memberTag, String name, String kind) {
    ListBuffer<JCTree> members = new ListBuffer<>();
    NodeList nodes = memberTag.getChildNodes();
    HashMap<String, Integer> scope = new HashMap<>();
    for (int i = 0; i < nodes.getLength(); i++) {
        Node node = nodes.item(i);

        if (!(node instanceof Element))
            continue;

        switch (((Element)node).getTagName()) {
            case "field":
                members.appendList(processFields((Element)node, scope));
                break;
            case "serialfield":
                members.append(processSerialFields((Element)node));
                break;
            case "constant":
                members.appendList(processConstants((Element)node, scope));
                break;
            case "constructor":
                members.appendList(processMethods((Element)node, scope, true, true));
                break;
            case "method":
                boolean needBody = kind.equals("class") || kind.equals("enum");
                members.appendList(processMethods((Element)node, scope, needBody, false));
                break;
            case "class":
            case "interface":
            case "enum":
            case "annotation":
                members.appendList(processBases((Element)node, scope)[0]);
                break;
        }
    }

    return members;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:39,代码来源:PackageGenerator.java

示例3: addAllClassesTo

import com.sun.tools.javac.util.ListBuffer; //导入方法依赖的package包/类
/**
 * Add all included classes (including Exceptions and Errors)
 * and interfaces.
 */
public void addAllClassesTo(ListBuffer<ClassDocImpl> list) {
    list.appendList(getClasses(true));
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:8,代码来源:PackageDocImpl.java


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