Package org.eclipse.jdt.internal.compiler.env

Examples of org.eclipse.jdt.internal.compiler.env.ICompilationUnit


                private NameEnvironmentAnswer findType(String className) {

                    InputStream is = null;
                    try {
                        if (className.equals(targetClassName)) {
                            ICompilationUnit compilationUnit =
                                new CompilationUnit(sourceFile, className);
                            return
                                new NameEnvironmentAnswer(compilationUnit, null);
                        }
                        String resourceName =
View Full Code Here


               
                private NameEnvironmentAnswer findType(String className) {

                    try {
                        if (className.equals(targetClassName)) {
                            ICompilationUnit compilationUnit =
                                new CompilationUnit(sourceFile, className);
                            return
                                new NameEnvironmentAnswer(compilationUnit);
                        }
                        String resourceName =
View Full Code Here

                        if (applicationClass.javaByteCode != null) {
                            ClassFileReader classFileReader = new ClassFileReader(applicationClass.javaByteCode, fileName, true);
                            return new NameEnvironmentAnswer(classFileReader, null);
                        }
                        // Cascade compilation
                        ICompilationUnit compilationUnit = new CompilationUnit(name);
                        return new NameEnvironmentAnswer(compilationUnit, null);
                    }

                    // So it's a standard class
                    byte[] bytes = Play.classloader.getClassDefinition(name);
View Full Code Here

                private NameEnvironmentAnswer findType(String className) {

                    InputStream is = null;
                    try {
                        if (className.equals(targetClassName)) {
                            ICompilationUnit compilationUnit =
                                new CompilationUnit(sourceFile, className);
                            return
                                new NameEnvironmentAnswer(compilationUnit, null);
                        }
                        String resourceName =
View Full Code Here

    for (Iterator iter = cudsByFileName.values().iterator(); iter.hasNext();) {
      CompilationUnitDeclaration cud = (CompilationUnitDeclaration) iter.next();
      // If we've seen this compilation unit before, the type oracle will
      // tell us about it and so we don't assimilate it again.
      //
      ICompilationUnit unit = cud.compilationResult.compilationUnit;
      ICompilationUnitAdapter adapter = ((ICompilationUnitAdapter) unit);
      CompilationUnitProvider cup = adapter.getCompilationUnitProvider();
      JClassType[] seen = oracle.getTypesInCompilationUnit(cup);
      if (seen.length > 0) {
        // This compilation unit has already been assimilated.
View Full Code Here

        new Class[] {TreeLogger.class}, oracle, new Object[] {logger});
    return oracle;
  }

  private CompilationUnitProvider getCup(TypeDeclaration typeDecl) {
    ICompilationUnit icu = typeDecl.compilationResult.compilationUnit;
    ICompilationUnitAdapter icua = (ICompilationUnitAdapter) icu;
    return icua.getCompilationUnitProvider();
  }
View Full Code Here

          Iterator it = typeNames.iterator();
          while (it.hasNext()) {
            String typeName = (String) it.next();

            try {
              ICompilationUnit compilationUnit = astCompiler.getCompilationUnitForType(
                  TreeLogger.NULL, typeName);

              String dependeeFilename = String.valueOf(compilationUnit.getFileName());
              String dependerFilename = String.valueOf(scope.compilationResult().compilationUnit.getFileName());

              dependencies.add(dependerFilename, dependeeFilename);

            } catch (UnableToCompleteException e) {
View Full Code Here

    //
    String top = stripNestedTypeNames(binaryTypeName);

    // Check the cache.
    //
    ICompilationUnit unit = (ICompilationUnit) unitsByTypeName.get(top);
    if (unit != null) {
      return unit;
    }

    // Not cached, so actually look for it.
View Full Code Here

        // refresh the total number of units known at this stage
        cud.compilationResult.totalUnitsKnown = totalUnits;
      }

      ICompilationUnit cu = cud.compilationResult.compilationUnit;
      String loc = String.valueOf(cu.getFileName());
      TreeLogger logger = threadLogger.branch(TreeLogger.SPAM,
          "Scanning for additional dependencies: " + loc, null);

      // Examine the cud for magic types.
      //
View Full Code Here

    // Need to compile it. It could be the case that we have tried before and
    // failed, but on the off chance that it's been fixed since then, we adopt
    // a policy of always trying to recompile if we don't have it cached.
    //
    ICompilationUnit start = getCompilationUnitForType(logger, binaryTypeName);
    compile(logger, new ICompilationUnit[] {start});

    // Check the cache again. If it's there now, we succeeded.
    // If it isn't there now, we've already logged the error.
    //
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.internal.compiler.env.ICompilationUnit

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.