本文整理汇总了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);
}
}
示例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;
}
示例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));
}