Java Code Examples for com.sun.tools.javac.util.ListBuffer#appendList()

The following examples show how to use com.sun.tools.javac.util.ListBuffer#appendList() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
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);
    }
}
 
Example 2
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;
}
 
Example 3
@Override public void appendBuildCode(SingularData data, JavacNode builderType, JCTree source, ListBuffer<JCStatement> statements, Name targetVariableName) {
	if (useGuavaInstead(builderType)) {
		guavaMapSingularizer.appendBuildCode(data, builderType, source, statements, targetVariableName);
		return;
	}
	
	JavacTreeMaker maker = builderType.getTreeMaker();
	
	if (data.getTargetFqn().equals("java.util.Map")) {
		statements.appendList(createJavaUtilSetMapInitialCapacitySwitchStatements(maker, data, builderType, true, "emptyMap", "singletonMap", "LinkedHashMap", source));
	} else {
		statements.appendList(createJavaUtilSimpleCreationAndFillStatements(maker, data, builderType, true, true, false, true, "TreeMap", source));
	}
}
 
Example 4
@Override public void appendBuildCode(SingularData data, JavacNode builderType, JCTree source, ListBuffer<JCStatement> statements, Name targetVariableName) {
	if (useGuavaInstead(builderType)) {
		guavaListSetSingularizer.appendBuildCode(data, builderType, source, statements, targetVariableName);
		return;
	}
	
	JavacTreeMaker maker = builderType.getTreeMaker();
	
	if (data.getTargetFqn().equals("java.util.Set")) {
		statements.appendList(createJavaUtilSetMapInitialCapacitySwitchStatements(maker, data, builderType, false, "emptySet", "singleton", "LinkedHashSet", source));
	} else {
		statements.appendList(createJavaUtilSimpleCreationAndFillStatements(maker, data, builderType, false, true, false, true, "TreeSet", source));
	}
}
 
Example 5
/**
 * Add all included classes (including Exceptions and Errors)
 * and interfaces.
 */
public void addAllClassesTo(ListBuffer<ClassDocImpl> list) {
    list.appendList(getClasses(true));
}
 
Example 6
/**
 * Add all included classes (including Exceptions and Errors)
 * and interfaces.
 */
public void addAllClassesTo(ListBuffer<ClassDocImpl> list) {
    list.appendList(getClasses(true));
}
 
Example 7
/**
 * Add all included classes (including Exceptions and Errors)
 * and interfaces.
 */
public void addAllClassesTo(ListBuffer<ClassDocImpl> list) {
    list.appendList(getClasses(true));
}
 
Example 8
/**
 * Add all included classes (including Exceptions and Errors)
 * and interfaces.
 */
public void addAllClassesTo(ListBuffer<ClassDocImpl> list) {
    list.appendList(getClasses(true));
}
 
Example 9
/**
 * Add all included classes (including Exceptions and Errors)
 * and interfaces.
 */
public void addAllClassesTo(ListBuffer<ClassDocImpl> list) {
    list.appendList(getClasses(true));
}
 
Example 10
/**
 * Add all included classes (including Exceptions and Errors)
 * and interfaces.
 */
public void addAllClassesTo(ListBuffer<ClassDocImpl> list) {
    list.appendList(getClasses(true));
}
 
Example 11
/**
 * Add all included classes (including Exceptions and Errors)
 * and interfaces.
 */
public void addAllClassesTo(ListBuffer<ClassDocImpl> list) {
    list.appendList(getClasses(true));
}
 
Example 12
/**
 * Add all included classes (including Exceptions and Errors)
 * and interfaces.
 */
public void addAllClassesTo(ListBuffer<ClassDocImpl> list) {
    list.appendList(getClasses(true));
}