Examples of newImportDeclaration()


Examples of com.asakusafw.utils.java.model.syntax.ModelFactory.newImportDeclaration()

        List<ImportDeclaration> results = new ArrayList<ImportDeclaration>();
        for (QualifiedName name : imported.keySet()) {
            if (implicit.contains(name.getQualifier())) {
                continue;
            }
            results.add(f.newImportDeclaration(ImportKind.SINGLE_TYPE, name));
        }
        Collections.sort(results, ImportComparator.INSTANCE);
        return results;
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.dom.AST.newImportDeclaration()

      return null;
    }
  }
 
  AST ast = this.cuAST.getAST();
  ImportDeclaration importDeclaration = ast.newImportDeclaration();
  importDeclaration.setStatic(Flags.isStatic(this.flags));
  // split import name into individual fragments, checking for on demand imports
  char[][] charFragments = CharOperation.splitOn('.', importActualName.toCharArray(), 0, importActualName.length());
  int length = charFragments.length;
  String[] strFragments = new String[length];
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newImportDeclaration()

            importsToBeRemoved.add(anImportDecl);
        }

        imports.removeAll(importsToBeRemoved);

        ImportDeclaration importDecl = ast.newImportDeclaration();
        importDecl.setName(ast.newName("com.google.gwt.user.client.rpc.AsyncCallback")); //$NON-NLS-1$
        astRoot.imports().add(importDecl);

        // Add Async to the name
        TypeDeclaration aRemoteService = (TypeDeclaration) astRoot.types().get(0);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newImportDeclaration()

         
        }
       
        imports.removeAll(importsToBeRemoved);

        ImportDeclaration importDecl = ast.newImportDeclaration();
        importDecl.setName(ast.newName("com.google.gwt.user.client.rpc.AsyncCallback")); //$NON-NLS-1$
        astRoot.imports().add(importDecl);

        // Add Async to the name
        TypeDeclaration aRemoteService = (TypeDeclaration) astRoot.types().get(0);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newImportDeclaration()

            importsToBeRemoved.add(anImportDecl);
        }
       
        imports.removeAll(importsToBeRemoved);

        ImportDeclaration importDecl = ast.newImportDeclaration();
        importDecl.setName(ast.newName("com.google.gwt.user.client.rpc.AsyncCallback")); //$NON-NLS-1$
        astRoot.imports().add(importDecl);

        // Add Async to the name
        TypeDeclaration aRemoteService = (TypeDeclaration) astRoot.types().get(0);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newImportDeclaration()

                    break;
                }
            }

            if (transform) {
                ImportDeclaration importDeclaration = ast
                        .newImportDeclaration();
                importDeclaration.setName(AbstractTransformer.createName(ast,
                        fullName));
                root.imports().add(importDeclaration);
                loader.importClass(fullName);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newImportDeclaration()

                }
            }
        }

        AST ast = root.getAST();
        ImportDeclaration declaration = ast.newImportDeclaration();
        declaration.setName(createName(ast, name));
        root.imports().add(declaration);
        loader.importClass(name);
        return simpleName;
    }
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newImportDeclaration()

  void addImportToCompilationUnit(String classToImport, CompilationUnit compilationUnit) {
    if (!isClassImported(classToImport, compilationUnit)) {
      AST ast = compilationUnit.getAST();

      Name name = createQualifiedName(ast, classToImport);
      ImportDeclaration importDeclaration = ast.newImportDeclaration();
      importDeclaration.setName(name);
      importDeclaration.setOnDemand(false);
      importDeclaration.setStatic(false);

      compilationUnit.imports().add(importDeclaration);
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newImportDeclaration()

      if (importDeclaration.getName().toString().equals(qualifiedName)) {
        return;
      }
    }
    // add new ImportDeclaration
    ImportDeclaration importDeclaration = ast.newImportDeclaration();
    importDeclaration.setName(ast.newName(qualifiedName));
    imports.add(importDeclaration);
  }

  /**
 
View Full Code Here

Examples of org.eclipse.jdt.core.dom.AST.newImportDeclaration()

      }
    }
    else group = model;
    // 2°) Second step, we build a rewriter from the compilation unit
    AST ast = u.getAST();
    ImportDeclaration id = ast.newImportDeclaration();
    id.setName(ast.newName(new String[] {"java", "util", "Set"}));
    ASTRewrite rewriter = ASTRewrite.create(ast);
    // 3°) Third step, we can process the type declaration
    if(t.isInterface()) {
      result = new InterfaceService(t, group, rewriter, u);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.