当前位置: 首页>>代码示例>>Java>>正文


Java EclipseCompiler类代码示例

本文整理汇总了Java中org.eclipse.jdt.internal.compiler.tool.EclipseCompiler的典型用法代码示例。如果您正苦于以下问题:Java EclipseCompiler类的具体用法?Java EclipseCompiler怎么用?Java EclipseCompiler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EclipseCompiler类属于org.eclipse.jdt.internal.compiler.tool包,在下文中一共展示了EclipseCompiler类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: compile

import org.eclipse.jdt.internal.compiler.tool.EclipseCompiler; //导入依赖的package包/类
static private boolean compile(Iterable<? extends Processor> processors)
{
    JavaCompiler compiler = new EclipseCompiler();
    DiagnosticCollector<JavaFileObject> diagnosticCollector =
            new DiagnosticCollector<JavaFileObject>();
    JavaFileManager fileManager = compiler.getStandardFileManager(diagnosticCollector, Locale.getDefault(), UTF_8);
    JavaCompiler.CompilationTask task = compiler.getTask(
            null,
            fileManager,
            diagnosticCollector,
            ImmutableSet.<String>of(),
            ImmutableSet.of(TestTypesEclipse.class.getCanonicalName()),
            ImmutableSet.<JavaFileObject>of());
    task.setProcessors(processors);
    return task.call();
}
 
开发者ID:wrmsr,项目名称:wava,代码行数:17,代码来源:TestTypesEclipse.java

示例2: getEclipseJavaCompiler

import org.eclipse.jdt.internal.compiler.tool.EclipseCompiler; //导入依赖的package包/类
static Optional<JavaCompiler> getEclipseJavaCompiler() {
    try {
        return Optional.of(new EclipseCompiler());
    } catch (NoClassDefFoundError err) {
        return Optional.empty();
    }
}
 
开发者ID:greenjoe,项目名称:lambdaFromString,代码行数:8,代码来源:JavaCompilerProvider.java

示例3: usingWithSetsParameters

import org.eclipse.jdt.internal.compiler.tool.EclipseCompiler; //导入依赖的package包/类
@Test
public void usingWithSetsParameters(){
    HelperClassSourceProvider helper = new DefaultHelperClassSourceProvider();
    ClassFactory classFactory = new DefaultClassFactory();
    String[] staticImports = new String[]{"si1","si2"};
    String[] imports = new String[]{"i1","i2"};
    String compilationClassPath = "compilationClassPath";
    ClassLoader parentClassLoader = new URLClassLoader(new URL[]{});
    JavaCompiler javaCompiler = new EclipseCompiler();

    LambdaFactoryConfiguration changedConfiguration = LambdaFactoryConfiguration.get()
            .withHelperClassSourceProvider(helper)
            .withClassFactory(classFactory)
            .withStaticImports(staticImports)
            .withImports(imports)
            .withCompilationClassPath(compilationClassPath)
            .withParentClassLoader(parentClassLoader)
            .withJavaCompiler(javaCompiler);


    assertSame(helper, changedConfiguration.getDefaultHelperClassSourceProvider());
    assertSame(classFactory, changedConfiguration.getClassFactory());
    assertEquals(Arrays.asList(staticImports), changedConfiguration.getStaticImports());
    assertEquals(Arrays.asList(imports), changedConfiguration.getImports());
    assertEquals(compilationClassPath, changedConfiguration.getCompilationClassPath());
    assertSame(parentClassLoader, changedConfiguration.getParentClassLoader());
    assertSame(javaCompiler, changedConfiguration.getJavaCompiler());

}
 
开发者ID:greenjoe,项目名称:lambdaFromString,代码行数:30,代码来源:LambdaFactoryConfigurationTest.java

示例4: factories

import org.eclipse.jdt.internal.compiler.tool.EclipseCompiler; //导入依赖的package包/类
@Parameterized.Parameters(name = "{1}")
public static Iterable<Object[]> factories(){
    JavaCompiler jdkCompiler = JavaCompilerProvider.getJdkJavaCompiler().get();
    JavaCompiler eclipseCompiler = new EclipseCompiler();
    return Arrays.asList(new Object[][]{
            {eclipseCompiler, "Default (Eclipse Compiler)"},
            {jdkCompiler, "JDK Compiler"}
    });
}
 
开发者ID:greenjoe,项目名称:lambdaFromString,代码行数:10,代码来源:LambdaFactoryTest.java

示例5: compile

import org.eclipse.jdt.internal.compiler.tool.EclipseCompiler; //导入依赖的package包/类
static private boolean compile(Iterable<? extends Processor> processors) {
  JavaCompiler compiler = new EclipseCompiler();
  DiagnosticCollector<JavaFileObject> diagnosticCollector =
      new DiagnosticCollector<JavaFileObject>();
  JavaFileManager fileManager = compiler.getStandardFileManager(diagnosticCollector, Locale.getDefault(), UTF_8);
  JavaCompiler.CompilationTask task = compiler.getTask(
      null,
      fileManager,
      diagnosticCollector,
      ImmutableSet.<String>of(),
      ImmutableSet.of(TypesEclipseTest.class.getCanonicalName()),
      ImmutableSet.<JavaFileObject>of());
  task.setProcessors(processors);
  return task.call();
}
 
开发者ID:square,项目名称:javapoet,代码行数:16,代码来源:TypesEclipseTest.java

示例6: eclipseCompiler

import org.eclipse.jdt.internal.compiler.tool.EclipseCompiler; //导入依赖的package包/类
public static JavaCompiler eclipseCompiler() {
  return new EclipseCompiler();
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:4,代码来源:Compiler.java


注:本文中的org.eclipse.jdt.internal.compiler.tool.EclipseCompiler类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。