@Override
 public Void visit(ObjectCreationExpr expr, AElement elem) {
   ClassOrInterfaceType type = expr.getType();
   AClass clazz = scene.classes.vivify(type.getName());
   Expression scope = expr.getScope();
   List<Type> typeArgs = expr.getTypeArgs();
   List<Expression> args = expr.getArgs();
   List<BodyDeclaration> decls = expr.getAnonymousClassBody();
   if (scope != null) {
     scope.accept(this, elem);
   }
   if (args != null) {
     for (Expression arg : args) {
       arg.accept(this, elem);
     }
   }
   if (typeArgs != null) {
     for (Type typeArg : typeArgs) {
       typeArg.accept(this, elem);
     }
   }
   type.accept(this, clazz);
   if (decls != null) {
     for (BodyDeclaration decl : decls) {
       decl.accept(this, clazz);
     }
   }
   return null;
 }
Пример #2
0
 @Override
 public void visit(ClassOrInterfaceType n, Object arg) {
   printAnnotations(n.getAnnotations(), arg);
   if (n.getScope() != null) {
     n.getScope().accept(this, arg);
     printer.print(".");
   }
   printer.print(n.getName());
   printTypeArgs(n.getTypeArgs(), arg);
 }