Package org.codehaus.janino.Java.CompilationUnit

Examples of org.codehaus.janino.Java.CompilationUnit.ImportDeclaration


        // Compile non-static import declarations. (Must be done here in the constructor and not
        // down in "compileUnit()" because otherwise "resolve()" cannot resolve type names.)
        this.typeImportsOnDemand = new ArrayList();
        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


        this.debugLines = debugLines;
        this.debugVars = debugVars;
       
        // 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

TOP

Related Classes of org.codehaus.janino.Java.CompilationUnit.ImportDeclaration

Copyright © 2018 www.massapicom. 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.