Package org.stjs.generator

Examples of org.stjs.generator.GeneratorConfiguration


      GenerationDirectory targetFolder = new GenerationDirectory(new File(outputDir), null, null);
      File generationFolder = targetFolder.getAbsolutePath();

      GeneratorConfigurationBuilder configBuilder = new GeneratorConfigurationBuilder();
      configBuilder.allowedPackage(builtProjectClassLoader.loadClass(className).getPackage().getName());
      GeneratorConfiguration configuration = configBuilder.build();

      gen.init(builtProjectClassLoader, configuration.getSourceEncoding());
      gen.generateJavascript(builtProjectClassLoader, className, sourceFolder, targetFolder, generationFolder, configuration);
    }
    catch (Exception e) {
      throw Throwables.propagate(e);
    }
View Full Code Here


        + " is not allowed. If it's one of your own bridge types, "
        + "please add the annotation @STJSBridge to the class or to its package.");
  }

  private boolean isJavaLangClassAllowed(GenerationContext<?> context, String name) {
    GeneratorConfiguration configuration = context.getConfiguration();
    if (name.startsWith(JAVA_LANG_PACKAGE) && configuration.getAllowedJavaLangClasses().contains(name.substring(JAVA_LANG_LENGTH))) {
      return true;
    }

    return false;
  }
View Full Code Here

  private boolean isPackageAllowed(GenerationContext<?> context, String name) {
    if (name.startsWith(JAVA_LANG_PACKAGE)) {
      return false;
    }
    GeneratorConfiguration configuration = context.getConfiguration();
    for (String packageName : configuration.getAllowedPackages()) {
      if (name.startsWith(packageName)) {
        return true;
      }
    }
    return false;
View Full Code Here

TOP

Related Classes of org.stjs.generator.GeneratorConfiguration

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.