本文整理汇总了Java中com.sun.tools.javac.util.ListBuffer.addAll方法的典型用法代码示例。如果您正苦于以下问题:Java ListBuffer.addAll方法的具体用法?Java ListBuffer.addAll怎么用?Java ListBuffer.addAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.util.ListBuffer
的用法示例。
在下文中一共展示了ListBuffer.addAll方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: completeAutomaticModule
import com.sun.tools.javac.util.ListBuffer; //导入方法依赖的package包/类
private void completeAutomaticModule(ModuleSymbol msym) throws CompletionFailure {
ListBuffer<Directive> directives = new ListBuffer<>();
directives.addAll(msym.directives);
ListBuffer<RequiresDirective> requires = new ListBuffer<>();
for (ModuleSymbol ms : allModules()) {
if (ms == syms.unnamedModule || ms == msym)
continue;
Set<RequiresFlag> flags = (ms.flags_field & Flags.AUTOMATIC_MODULE) != 0 ?
EnumSet.of(RequiresFlag.TRANSITIVE) : EnumSet.noneOf(RequiresFlag.class);
RequiresDirective d = new RequiresDirective(ms, flags);
directives.add(d);
requires.add(d);
}
RequiresDirective requiresUnnamed = new RequiresDirective(syms.unnamedModule);
directives.add(requiresUnnamed);
requires.add(requiresUnnamed);
msym.requires = requires.toList();
msym.directives = directives.toList();
}
示例2: visitClassDef
import com.sun.tools.javac.util.ListBuffer; //导入方法依赖的package包/类
@Override
public void visitClassDef(JCClassDecl tree) {
if ((tree.mods.flags & (INTERFACE | ENUM)) == 0 &&
!tree.getMembers().stream()
.anyMatch(t -> t.getKind() == Tree.Kind.METHOD &&
((MethodTree) t).getName() == tree.name.table.names.init)) {
// Generate a default constructor, since
// this is a regular class and there are no constructors
ListBuffer<JCTree> ndefs = new ListBuffer<>();
ndefs.addAll(tree.defs);
ndefs.add(make.MethodDef(make.Modifiers(PUBLIC),
tree.name.table.names.init,
null, List.nil(), List.nil(), List.nil(),
resolutionExceptionBlock(), null));
tree.defs = ndefs.toList();
}
super.visitClassDef(tree);
}
示例3: newDocCommentTree
import com.sun.tools.javac.util.ListBuffer; //导入方法依赖的package包/类
@Override @DefinedBy(Api.COMPILER_TREE)
public DCDocComment newDocCommentTree(List<? extends DocTree> fullBody, List<? extends DocTree> tags) {
ListBuffer<DCTree> lb = new ListBuffer<>();
lb.addAll(cast(fullBody));
List<DCTree> fBody = lb.toList();
// A dummy comment to keep the diagnostics logic happy.
Comment c = new Comment() {
@Override
public String getText() {
return null;
}
@Override
public int getSourcePos(int index) {
return Position.NOPOS;
}
@Override
public CommentStyle getStyle() {
return CommentStyle.JAVADOC;
}
@Override
public boolean isDeprecated() {
return false;
}
};
Pair<List<DCTree>, List<DCTree>> pair = splitBody(fullBody);
DCDocComment tree = new DCDocComment(c, fBody, pair.fst, pair.snd, cast(tags));
return tree;
}