Examples of ImportVisitor


Examples of jdolly.visitors.ImportVisitor

      result.add(compilationUnit);
    }

    // colocar imports
    for (CompilationUnit cu : result) {
      ImportVisitor cv = new ImportVisitor();
      cu.accept(cv);
      Name packageName = cu.getPackage().getName();
      // System.out.println("Superclass: " + cv.getSuperClassName());

      List<String> importedPackages = new ArrayList<String>();

      for (CompilationUnit cu2 : result) {
        Name packageToCompare = cu2.getPackage().getName();
        ImportDeclaration importDeclaration = null;
        if (packageName.getFullyQualifiedName().equals(
            packageToCompare.getFullyQualifiedName()))
          continue;
        ImportCheckerVisitor iv = new ImportCheckerVisitor();
        cu2.accept(iv);

        // adiciona o import para super class
        if (iv.getClassName().equals(cv.getSuperClassName())) {
          importDeclaration = importPacakge(packageToCompare);

        }
        // adiciona o import para fields
        else {
          for (String fieldType : cv.getFieldTypes()) {
            if (iv.getClassName().equals(fieldType)) {
              importDeclaration = importPacakge(packageToCompare);
              break;
            }
          }
          if (importDeclaration == null) {
            for (String instanceType : cv.getInstanceTypes()) {
              if (iv.getClassName().equals(instanceType)) {
                importDeclaration = importPacakge(packageToCompare);
                break;
              }
            }
View Full Code Here

Examples of org.codehaus.janino.Visitor.ImportVisitor

        this.typeImportsOnDemand.add(new String[] { "java", "lang" });
        for (Iterator it = this.compilationUnit.importDeclarations.iterator(); it.hasNext();) {
            ImportDeclaration id = (ImportDeclaration) it.next();
            class UCE extends RuntimeException { final CompileException ce; UCE(CompileException ce) { this.ce = ce; } }
            try {
                id.accept(new ImportVisitor() {
                    // CHECKSTYLE(LineLengthCheck):OFF
                    public void visitSingleTypeImportDeclaration(SingleTypeImportDeclaration stid)          { try { UnitCompiler.this.import2(stid)} catch (CompileException e) { throw new UCE(e); } }
                    public void visitTypeImportOnDemandDeclaration(TypeImportOnDemandDeclaration tiodd)     {       UnitCompiler.this.import2(tiodd);                                                    }
                    public void visitSingleStaticImportDeclaration(SingleStaticImportDeclaration ssid)      {}
                    public void visitStaticImportOnDemandDeclaration(StaticImportOnDemandDeclaration siodd) {}
View Full Code Here

Examples of org.codehaus.janino.Visitor.ImportVisitor

        // Compile static import declarations.
        for (Iterator it = this.compilationUnit.importDeclarations.iterator(); it.hasNext();) {
            ImportDeclaration id = (ImportDeclaration) it.next();
            class UCE extends RuntimeException { final CompileException ce; UCE(CompileException ce) { this.ce = ce; } }
            try {
                id.accept(new ImportVisitor() {
                    // CHECKSTYLE(LineLengthCheck):OFF
                    public void visitSingleTypeImportDeclaration(SingleTypeImportDeclaration stid)          {}
                    public void visitTypeImportOnDemandDeclaration(TypeImportOnDemandDeclaration tiodd)     {}
                    public void visitSingleStaticImportDeclaration(SingleStaticImportDeclaration ssid)      { try { UnitCompiler.this.import2(ssid)} catch (CompileException e) { throw new UCE(e); } }
                    public void visitStaticImportOnDemandDeclaration(StaticImportOnDemandDeclaration siodd) { try { UnitCompiler.this.import2(siodd); } catch (CompileException e) { throw new UCE(e); } }
View Full Code Here

Examples of org.python.pydev.refactoring.ast.visitors.info.ImportVisitor

        return (IClassDefAdapter) bestClassScope;
    }

    private void initAliasList() {
        ImportVisitor visitor = VisitorFactory.createVisitor(ImportVisitor.class, getASTNode());
        this.importedModules = visitor.getImportedModules();
        this.aliasToFQIdentifier = visitor.getAliasToFQIdentifier();
    }
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.