Examples of newPackageDeclaration()


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

    }

    private CompilationUnit getErroneousSource() {
        ModelFactory f = Models.getModelFactory();
        CompilationUnit cu = f.newCompilationUnit(
                f.newPackageDeclaration(Models.toName(f, "com.example")),
                Collections.<ImportDeclaration>emptyList(),
                Collections.singletonList(f.newClassDeclaration(
                        null,
                        new AttributeBuilder(f)
                            .Public()
View Full Code Here

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

    }

    private CompilationUnit java(String name) {
        ModelFactory f = Models.getModelFactory();
        return f.newCompilationUnit(
                f.newPackageDeclaration(Models.toName(f, "com.example")),
                Collections.<ImportDeclaration>emptyList(),
                Collections.singletonList(f.newClassDeclaration(
                        null,
                        new AttributeBuilder(f)
                            .Public()
View Full Code Here

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

        assert requiresReducer(slot);
        ModelFactory f = environment.getModelFactory();
        SimpleName className = f.newSimpleName(Naming.getMapClass(index));
        ImportBuilder importer = new ImportBuilder(
                f,
                f.newPackageDeclaration(environment.getEpiloguePackageName(moduleId)),
                Strategy.TOP_LEVEL);
        importer.resolvePackageMember(className);
        List<Expression> arguments = Lists.create();
        arguments.add(Models.toLiteral(f, index));
        arguments.add(classLiteralOrNull(f, importer, key));
View Full Code Here

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

        assert requiresReducer(slot) == false;
        ModelFactory f = environment.getModelFactory();
        SimpleName className = f.newSimpleName(Naming.getMapClass(index));
        ImportBuilder importer = new ImportBuilder(
                f,
                f.newPackageDeclaration(environment.getEpiloguePackageName(moduleId)),
                Strategy.TOP_LEVEL);
        importer.resolvePackageMember(className);
        List<Expression> arguments = Lists.create();
        arguments.add(f.newClassLiteral(importer.toType(slot.valueType)));
        arguments.add(Models.toLiteral(f, slot.basePath));
View Full Code Here

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

        assert slots != null;
        ModelFactory f = environment.getModelFactory();
        SimpleName className = f.newSimpleName(classNameString);
        ImportBuilder importer = new ImportBuilder(
                f,
                f.newPackageDeclaration(environment.getEpiloguePackageName(moduleId)),
                Strategy.TOP_LEVEL);
        importer.resolvePackageMember(className);
        List<Expression> elements = Lists.create();
        for (Slot slot : slots) {
            if (requiresReducer(slot)) {
View Full Code Here

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

        assert argumentClassName != null;
        ModelFactory f = environment.getModelFactory();
        SimpleName className = f.newSimpleName(classNameString);
        ImportBuilder importer = new ImportBuilder(
                f,
                f.newPackageDeclaration(environment.getEpiloguePackageName(moduleId)),
                Strategy.TOP_LEVEL);
        importer.resolvePackageMember(className);
        List<Expression> arguments = Lists.create();
        arguments.add(classLiteralOrNull(f, importer, argumentClassName));
        return emitConstructorClass(className, importer.toType(baseClass), importer, arguments);
View Full Code Here

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

        // rename package statement
        Name name = ast.newName(pkgName);
        rewriter.set(pkg, PackageDeclaration.NAME_PROPERTY, name, null);
      } else {
        // create new package statement
        pkg = ast.newPackageDeclaration();
        pkg.setName(ast.newName(pkgName));
        rewriter.set(astCU, CompilationUnit.PACKAGE_PROPERTY, pkg, null);
      }
    }
  }
View Full Code Here

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

      this.creationOccurred = false;
      return null;
    }
  }
  AST ast = this.cuAST.getAST();
  PackageDeclaration pkgDeclaration = ast.newPackageDeclaration();
  Name astName = ast.newName(this.name);
  pkgDeclaration.setName(astName);
  return pkgDeclaration;
}
/**
 
View Full Code Here

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

          // Create new CompilationUnit
          try {
            AST ast = AST.newAST(AST.JLS3);
            CompilationUnit unit = ast.newCompilationUnit();
            PackageDeclaration packageDeclaration = ast
                .newPackageDeclaration();
            packageDeclaration.setName(ast.newSimpleName(pkg
                .getElementName()));
            unit.setPackage(packageDeclaration);
            TypeDeclaration type = ast.newTypeDeclaration();
View Full Code Here

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

        // rename package statement
        Name name = ast.newName(pkgName);
        rewriter.set(pkg, PackageDeclaration.NAME_PROPERTY, name, null);
      } else {
        // create new package statement
        pkg = ast.newPackageDeclaration();
        pkg.setName(ast.newName(pkgName));
        rewriter.set(astCU, CompilationUnit.PACKAGE_PROPERTY, pkg, null);
      }
    }
  }
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.