Logo Search packages:      
Sourcecode: janino version File versions  Download package

IClass org::codehaus::janino::UnitCompiler::findClass ( String  className  )  [inline]

Find one class or interface by name.

Parameters:
className Fully qualified class name, e.g. "pkg1.pkg2.Outer$Inner".
Returns:
null if a class with that name is not declared in this compilation unit

Definition at line 7842 of file UnitCompiler.java.

Referenced by org::codehaus::janino::Compiler::CompilerIClassLoader::defineIClassFromSourceResource(), org::codehaus::janino::tools::JGrep::JGrepIClassLoader::findIClass(), org::codehaus::janino::JavaSourceIClassLoader::findIClass(), and org::codehaus::janino::Compiler::CompilerIClassLoader::findIClass().

                                              {

        // Examine package name.
        String packageName = (
            this.compilationUnit.optionalPackageDeclaration == null ? null :
            this.compilationUnit.optionalPackageDeclaration.packageName
        );
        if (packageName != null) {
            if (!className.startsWith(packageName + '.')) return null;
            className = className.substring(packageName.length() + 1);
        }

        StringTokenizer st = new StringTokenizer(className, "$");
        Java.TypeDeclaration td = this.compilationUnit.getPackageMemberTypeDeclaration(st.nextToken());
        if (td == null) return null;
        while (st.hasMoreTokens()) {
            td = td.getMemberTypeDeclaration(st.nextToken());
            if (td == null) return null;
        }
        return this.resolve((Java.AbstractTypeDeclaration) td);
    }


Generated by  Doxygen 1.6.0   Back to index