本文整理汇总了Java中org.walkmod.javalang.ast.expr.ObjectCreationExpr.getScope方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectCreationExpr.getScope方法的具体用法?Java ObjectCreationExpr.getScope怎么用?Java ObjectCreationExpr.getScope使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.walkmod.javalang.ast.expr.ObjectCreationExpr
的用法示例。
在下文中一共展示了ObjectCreationExpr.getScope方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.walkmod.javalang.ast.expr.ObjectCreationExpr; //导入方法依赖的package包/类
@Override
public void visit(ObjectCreationExpr n, A arg) {
if (n.getScope() != null) {
n.getScope().accept(this, arg);
}
if (n.getTypeArgs() != null) {
for (Type t : n.getTypeArgs()) {
t.accept(this, arg);
}
}
n.getType().accept(this, arg);
if (!AnonymousClassUtil.isAnonymousClass(n) || AnonymousClassUtil.needsSymbolData(n)) {
SymbolType st = (SymbolType) n.getType().getSymbolData();
resolveConstructor(n, n.getArgs(), st, arg);
}
// we need to update the symbol table
if (semanticVisitor != null) {
n.accept(semanticVisitor, arg);
}
}
示例2: visit
import org.walkmod.javalang.ast.expr.ObjectCreationExpr; //导入方法依赖的package包/类
public R visit(ObjectCreationExpr n, A arg) {
if (n.getScope() != null) {
n.getScope().accept(this, arg);
}
if (n.getTypeArgs() != null) {
for (Type t : n.getTypeArgs()) {
t.accept(this, arg);
}
}
n.getType().accept(this, arg);
if (n.getArgs() != null) {
for (Expression e : n.getArgs()) {
e.accept(this, arg);
}
}
if (n.getAnonymousClassBody() != null) {
for (BodyDeclaration member : n.getAnonymousClassBody()) {
member.accept(this, arg);
}
}
return null;
}
示例3: visit
import org.walkmod.javalang.ast.expr.ObjectCreationExpr; //导入方法依赖的package包/类
public void visit(ObjectCreationExpr n, A arg) {
if (n.getScope() != null) {
n.getScope().accept(this, arg);
}
if (n.getTypeArgs() != null) {
for (Type t : n.getTypeArgs()) {
t.accept(this, arg);
}
}
n.getType().accept(this, arg);
if (n.getArgs() != null) {
for (Expression e : n.getArgs()) {
e.accept(this, arg);
}
}
if (n.getAnonymousClassBody() != null) {
for (BodyDeclaration member : n.getAnonymousClassBody()) {
member.accept(this, arg);
}
}
}
示例4: visit
import org.walkmod.javalang.ast.expr.ObjectCreationExpr; //导入方法依赖的package包/类
public Node visit(ObjectCreationExpr n, A arg) {
if (n.getScope() != null) {
n.setScope((Expression) n.getScope().accept(this, arg));
}
List<Type> typeArgs = n.getTypeArgs();
if (typeArgs != null) {
for (int i = 0; i < typeArgs.size(); i++) {
typeArgs.set(i, (Type) typeArgs.get(i).accept(this, arg));
}
removeNulls(typeArgs);
}
n.setType((ClassOrInterfaceType) n.getType().accept(this, arg));
List<Expression> args = n.getArgs();
if (args != null) {
for (int i = 0; i < args.size(); i++) {
args.set(i, (Expression) args.get(i).accept(this, arg));
}
removeNulls(args);
}
List<BodyDeclaration> anonymousClassBody = n.getAnonymousClassBody();
if (anonymousClassBody != null) {
for (int i = 0; i < anonymousClassBody.size(); i++) {
anonymousClassBody.set(i, (BodyDeclaration) anonymousClassBody.get(i).accept(this, arg));
}
removeNulls(anonymousClassBody);
}
return n;
}
示例5: visit
import org.walkmod.javalang.ast.expr.ObjectCreationExpr; //导入方法依赖的package包/类
public void visit(ObjectCreationExpr n, Object arg) {
prepareComments(n);
printPreviousComments(n, arg);
if (n.getScope() != null) {
n.getScope().accept(this, arg);
printer.print(".");
}
ClassOrInterfaceType type = n.getType();
printPreviousComments(type, arg);
int beginLine = n.getType().getEndLine();
printer.print("new ");
List<Type> typeArgs = n.getTypeArgs();
if (typeArgs != null) {
printTypeArgs(n.getTypeArgs(), arg);
printer.print(" ");
}
n.getType().accept(this, arg);
List<Expression> args = n.getArgs();
printArguments(args, arg);
if (args != null && !args.isEmpty()) {
Expression lastType = args.get(args.size() - 1);
int begin = lastType.getEndLine();
if (begin > beginLine) {
beginLine = begin;
}
}
if (n.getAnonymousClassBody() != null) {
printer.print(" {");
printer.indent();
List<BodyDeclaration> members = n.getAnonymousClassBody();
if (members != null) {
if (!members.isEmpty()) {
printFirstBlankLines(n, members, beginLine);
printChildrenNodes(n, members, null, arg);
printEntersAfterMembersAndBeforeComments(n, members);
}
}
printContainingCommentsAndEnters(n, members, arg, beginLine);
printer.unindent();
printer.print("}");
}
}