Package com.google.gwt.dev.javac

Examples of com.google.gwt.dev.javac.StandardGeneratorContext$GeneratedUnitImpl


  /**
   * Retrieves class definitions from a {@link GeneratorContext} by downcasting.
   */
  private Map<String, CompiledClass> extractClassFileMap() {
    if (context instanceof StandardGeneratorContext) {
      StandardGeneratorContext standardContext = (StandardGeneratorContext) context;
      return standardContext.getCompilationState().getClassFileMap();
    } else {
      logger.log(TreeLogger.Type.WARN,
          String.format("Could not load generated classes from GWT context, "
              + "encountered unexpected generator type %s.", context.getClass()));
      return null;
View Full Code Here


  }
 
 
  public static String getModuleName(final GeneratorContext context) {
    try {
      StandardGeneratorContext standardGeneratorContext =
              (StandardGeneratorContext) context;
      Field field = StandardGeneratorContext.class.getDeclaredField("module");
      field.setAccessible(true);
      ModuleDef moduleDef = (ModuleDef) field.get(standardGeneratorContext);
      return moduleDef.getCanonicalName();
View Full Code Here

   * Returns the list of translatable packages in the module that caused the generator to run (the module under compilation).
   */
  public static Set<String> findTranslatablePackagesInModule(final GeneratorContext context) {
    Set<String> packages = new HashSet<String>();
    try {
      StandardGeneratorContext stdContext = (StandardGeneratorContext) context;
      Field field = StandardGeneratorContext.class.getDeclaredField("module");
      field.setAccessible(true);
      ModuleDef moduleDef = (ModuleDef) field.get(stdContext);

      // moduleName looks like "com.foo.xyz.MyModule" and we just want the package part
View Full Code Here

    // Set up the rebind oracle for the module.
    // It has to wait until now because we need to inject javascript.
    //
    Rules rules = module.getRules();
    StandardGeneratorContext genCtx = new StandardGeneratorContext(
        compilationState, module, genDir, shellDir, new ArtifactSet());
    rebindOracle = new StandardRebindOracle(propOracle, rules, genCtx);

    // Create a completely isolated class loader which owns all classes
    // associated with a particular module. This effectively builds a
View Full Code Here

        PropertyPermutations perms, File genDir, File generatorResourcesDir) {
      this.compilationState = compilationState;
      permutations = new Permutation[perms.size()];
      propertyOracles = new StaticPropertyOracle[perms.size()];
      rebindOracles = new RebindOracle[perms.size()];
      generatorContext = new StandardGeneratorContext(compilationState, module,
          genDir, generatorResourcesDir, generatorArtifacts);
      BindingProperty[] orderedProps = perms.getOrderedProperties();
      SortedSet<ConfigurationProperty> configPropSet = module.getProperties().getConfigurationProperties();
      ConfigurationProperty[] configProps = configPropSet.toArray(new ConfigurationProperty[configPropSet.size()]);
      Rules rules = module.getRules();
View Full Code Here

    }
  }

  private static ModuleDef getModuleDef(final GeneratorContext context) {
    final StandardGeneratorContext standardGeneratorContext =
      (StandardGeneratorContext) context;
    try {
      Field moduleField = StandardGeneratorContext.class.getDeclaredField("module");
      moduleField.setAccessible(true);
      return (ModuleDef) moduleField.get(standardGeneratorContext);
View Full Code Here

   * module under compilation).
   */
  public static Set<String> findTranslatablePackagesInModule(final GeneratorContext context) {
    final Set<String> packages = new HashSet<String>();
    try {
      final StandardGeneratorContext stdContext = (StandardGeneratorContext) context;
      final Field field = StandardGeneratorContext.class.getDeclaredField("module");
      field.setAccessible(true);
      final Object o = field.get(stdContext);

      final ModuleDef moduleDef = (ModuleDef) o;
View Full Code Here

    // Set up the rebind oracle for the module.
    // It has to wait until now because we need to inject javascript.
    //
    Rules rules = module.getRules();
    StandardGeneratorContext genCtx = new StandardGeneratorContext(
        module.getCompilationState(logger), module, genDir, shellDir,
        new ArtifactSet());
    rebindOracle = new StandardRebindOracle(propOracle, rules, genCtx);

    // Create a completely isolated class loader which owns all classes
View Full Code Here

        CompilationState compilationState, ArtifactSet generatorArtifacts,
        PropertyPermutations perms, File genDir, File generatorResourcesDir) {
      permutations = new Permutation[perms.size()];
      propertyOracles = new StaticPropertyOracle[perms.size()];
      rebindOracles = new RebindOracle[perms.size()];
      generatorContext = new StandardGeneratorContext(compilationState, module,
          genDir, generatorResourcesDir, generatorArtifacts);
      BindingProperty[] orderedProps = perms.getOrderedProperties();
      SortedSet<ConfigurationProperty> configPropSet = module.getProperties().getConfigurationProperties();
      ConfigurationProperty[] configProps = configPropSet.toArray(new ConfigurationProperty[configPropSet.size()]);
      Rules rules = module.getRules();
View Full Code Here

   * Returns the list of translatable packages in the module that caused the generator to run (the module under compilation).
   */
  public static List<String> findTranslatablePackagesInModule(final GeneratorContext context) {
    List<String> packages = new ArrayList<String>();
    try {
      StandardGeneratorContext stdContext = (StandardGeneratorContext) context;
      Field field = StandardGeneratorContext.class.getDeclaredField("module");
      field.setAccessible(true);
      ModuleDef moduleDef = (ModuleDef) field.get(stdContext);

      // moduleName looks like "com.foo.xyz.MyModule" and we just want the package part
View Full Code Here

TOP

Related Classes of com.google.gwt.dev.javac.StandardGeneratorContext$GeneratedUnitImpl

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.