Package com.google.gwt.dev.javac.typemodel

Examples of com.google.gwt.dev.javac.typemodel.TypeOracle


    allRootTypes.addAll(JProgram.INDEX_TYPES_SET);
    /*
     * Add all SingleJsoImpl types that we know about. It's likely that the
     * concrete types are never explicitly referenced.
     */
    TypeOracle typeOracle = rpo.getCompilationState().getTypeOracle();
    for (com.google.gwt.core.ext.typeinfo.JClassType singleJsoIntf : typeOracle
        .getSingleJsoImplInterfaces()) {
      allRootTypes.add(typeOracle.getSingleJsoImpl(singleJsoIntf).getQualifiedSourceName());
    }

    Memory.maybeDumpMemory("CompStateBuilt");

    JProgram jprogram = new JProgram();
    JsProgram jsProgram = new JsProgram();

    try {
      // (2) Assemble the Java AST.
      UnifyAst unifyAst = new UnifyAst(jprogram, jsProgram, options, rpo);
      unifyAst.addRootTypes(allRootTypes);
      // TODO: move this into UnifyAst?
      findEntryPoints(logger, rpo, declEntryPts, jprogram);
      unifyAst.exec(logger);

      List<String> finalTypeOracleTypes = Lists.create();
      if (precompilationMetrics != null) {
        for (com.google.gwt.core.ext.typeinfo.JClassType type : typeOracle.getTypes()) {
          finalTypeOracleTypes =
              Lists.add(finalTypeOracleTypes, type.getPackage().getName() + "." + type.getName());
        }
        precompilationMetrics.setFinalTypeOracleTypes(finalTypeOracleTypes);
      }
View Full Code Here


          throw new TypeOracleException(e);
        }
      }
    }
    CompilationUnitTypeOracleUpdater typeOracleUpdater =
        new CompilationUnitTypeOracleUpdater(new TypeOracle());
    typeOracleUpdater.addNewTypesDontIndex(createTreeLogger(), typeDataList,
        new MethodArgNamesLookup());
    typeOracleUpdater.indexTypes();
    this.typeOracle = typeOracleUpdater.getTypeOracle();
    checkTypes(typeOracle.getTypes());
View Full Code Here

    Collection<CompilationUnit> resultUnits = compileMoreLater.compile(
        logger, compilerContext, builders, cachedUnits,
        CompilerEventType.JDT_COMPILER_CSB_FROM_ORACLE);

    boolean compileMonolithic = compilerContext.shouldCompileMonolithic();
    TypeOracle typeOracle = null;
    CompilationUnitTypeOracleUpdater typeOracleUpdater = null;
    if (compileMonolithic) {
      typeOracle = new TypeOracle();
      typeOracleUpdater = new CompilationUnitTypeOracleUpdater(typeOracle);
    } else {
      typeOracle = new LibraryTypeOracle(compilerContext);
      typeOracleUpdater = ((LibraryTypeOracle) typeOracle).getTypeOracleUpdater();
    }
View Full Code Here

          // ignore
        }
      }
    }
    boolean needsAllTypesIfRun = contentDependsOnTypes() && context.isGlobalCompile();
    TypeOracle typeModelTypeOracle =
        (com.google.gwt.dev.javac.typemodel.TypeOracle) context.getTypeOracle();

    context.setPropertyOracle(dynamicPropertyOracle);

    context.setCurrentGenerator(generatorClass);

    do {
      resultTypeNamesByProperties.clear();
      Properties accessedProperties = new Properties();

      List<BindingProperty> accessedPropertiesList =
          new ArrayList<BindingProperty>(dynamicPropertyOracle.getAccessedProperties());
      for (BindingProperty bindingProperty : accessedPropertiesList) {
        accessedProperties.addBindingProperty(bindingProperty);
      }
      PropertyPermutations permutationsOfAccessedProperties =
          new PropertyPermutations(accessedProperties, Sets.<String> newHashSet());

      for (int permutationId = 0; permutationId < permutationsOfAccessedProperties.size();
          permutationId++) {
        String[] orderedPropertyValues =
            permutationsOfAccessedProperties.getOrderedPropertyValues(permutationId);
        BindingProperty[] orderedProperties =
            permutationsOfAccessedProperties.getOrderedProperties();

        dynamicPropertyOracle.reset();
        for (int propertyIndex = 0; propertyIndex < orderedPropertyValues.length; propertyIndex++) {
          dynamicPropertyOracle.prescribePropertyValue(orderedProperties[propertyIndex].getName(),
              orderedPropertyValues[propertyIndex]);
        }

        if (!isApplicable(logger, context, typeName)) {
          continue;
        }
        if (needsAllTypesIfRun) {
          typeModelTypeOracle.ensureAllLoaded();
        }
        String resultTypeName;
        try {
          resultTypeName = getGenerator().generate(logger, context, typeName);
        } catch (UnsupportedTypeOracleAccess e) {
View Full Code Here

      CompilerContext compilerContext = compilerContextBuilder.build();
      ModuleDef module = ModuleDefLoader.loadFromClassPath(logger,
          compilerContext, Child.class.getPackage().getName() + ".Testing");
      compilerContext = compilerContextBuilder.module(module).build();
      CompilationState compilationState = module.getCompilationState(logger, compilerContext);
      TypeOracle typeOracle = compilationState.getTypeOracle();
      classType = typeOracle.findType(TEST_CLASS.getCanonicalName());
    } catch (UnableToCompleteException e) {
      throw new RuntimeException(e);
    }
    return new TypeOracleMessageInterface(new GwtLocaleFactoryImpl(),
        classType, null);
View Full Code Here

    Collection<CompilationUnit> resultUnits = compileMoreLater.compile(
        logger, compilerContext, builders, cachedUnits,
        CompilerEventType.JDT_COMPILER_CSB_FROM_ORACLE);

    boolean compileMonolithic = compilerContext.shouldCompileMonolithic();
    TypeOracle typeOracle = null;
    CompilationUnitTypeOracleUpdater typeOracleUpdater = null;
    if (compileMonolithic) {
      typeOracle = new TypeOracle();
      typeOracleUpdater = new CompilationUnitTypeOracleUpdater(typeOracle);
    } else {
      typeOracle = new LibraryTypeOracle(compilerContext);
      typeOracleUpdater = ((LibraryTypeOracle) typeOracle).getTypeOracleUpdater();
    }
View Full Code Here

          // ignore
        }
      }
    }
    boolean needsAllTypesIfRun = contentDependsOnTypes() && context.isGlobalCompile();
    TypeOracle typeModelTypeOracle =
        (com.google.gwt.dev.javac.typemodel.TypeOracle) context.getTypeOracle();

    context.setPropertyOracle(dynamicPropertyOracle);

    context.setCurrentGenerator(generatorClass);

    do {
      resultTypeNamesByProperties.clear();
      Properties accessedProperties = new Properties();

      List<BindingProperty> accessedPropertiesList =
          new ArrayList<BindingProperty>(dynamicPropertyOracle.getAccessedProperties());
      for (BindingProperty bindingProperty : accessedPropertiesList) {
        accessedProperties.addBindingProperty(bindingProperty);
      }
      PropertyPermutations permutationsOfAccessedProperties =
          new PropertyPermutations(accessedProperties, Sets.<String> newHashSet());

      for (int permutationId = 0; permutationId < permutationsOfAccessedProperties.size();
          permutationId++) {
        String[] orderedPropertyValues =
            permutationsOfAccessedProperties.getOrderedPropertyValues(permutationId);
        BindingProperty[] orderedProperties =
            permutationsOfAccessedProperties.getOrderedProperties();

        dynamicPropertyOracle.reset();
        for (int propertyIndex = 0; propertyIndex < orderedPropertyValues.length; propertyIndex++) {
          dynamicPropertyOracle.prescribePropertyValue(orderedProperties[propertyIndex].getName(),
              orderedPropertyValues[propertyIndex]);
        }

        if (!isApplicable(logger, context, typeName)) {
          continue;
        }
        if (needsAllTypesIfRun) {
          typeModelTypeOracle.ensureAllLoaded();
        }
        String resultTypeName;
        try {
          resultTypeName = getGenerator().generate(logger, context, typeName);
        } catch (UnsupportedTypeOracleAccess e) {
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.javac.typemodel.TypeOracle

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.