Package com.asakusafw.utils.java.model.syntax

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


        assertThat(environment.hasError(), is(false));
    }

    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)
View Full Code Here


        }
    }

    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)
View Full Code Here

                    .toAttributes(),
                className,
                importer.resolve(baseClass),
                Collections.<Type>emptyList(),
                Collections.singletonList(ctorDecl));
        CompilationUnit source = f.newCompilationUnit(
                importer.getPackageDeclaration(),
                importer.toImportDeclarations(),
                Collections.singletonList(typeDecl),
                Collections.<Comment>emptyList());
        environment.emit(source);
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.