public abstract class Compiler extends Object
compile(javax.tools.JavaFileObject...) Java source files.| Constructor and Description |
|---|
Compiler() |
| Modifier and Type | Method and Description |
|---|---|
abstract Optional<com.google.common.collect.ImmutableList<File>> |
classPath()
The compilation class path.
|
Compilation |
compile(Iterable<? extends JavaFileObject> files)
Compiles Java source files.
|
Compilation |
compile(JavaFileObject... files)
Compiles Java source files.
|
static Compiler |
compiler(JavaCompiler javaCompiler)
Returns a
Compiler that uses a given JavaCompiler instance. |
static Compiler |
javac()
Returns the
javac compiler. |
abstract com.google.common.collect.ImmutableList<String> |
options()
The options passed to the compiler.
|
abstract com.google.common.collect.ImmutableList<Processor> |
processors()
The annotation processors applied during compilation.
|
Compiler |
withClasspath(Iterable<File> classPath)
Uses the given classpath for the compilation instead of the system classpath.
|
Compiler |
withClasspathFrom(ClassLoader classloader)
Deprecated.
prefer
withClasspath(Iterable). This method only supports URLClassLoader and the default system classloader, and Files are usually a more
natural way to expression compilation classpaths than class loaders. |
Compiler |
withOptions(Iterable<?> options)
Passes command-line options to the compiler.
|
Compiler |
withOptions(Object... options)
Passes command-line options to the compiler.
|
Compiler |
withProcessors(Iterable<? extends Processor> processors)
Uses annotation processors during compilation.
|
Compiler |
withProcessors(Processor... processors)
Uses annotation processors during compilation.
|
public static Compiler javac()
javac compiler.public static Compiler compiler(JavaCompiler javaCompiler)
Compiler that uses a given JavaCompiler instance.public abstract com.google.common.collect.ImmutableList<Processor> processors()
public abstract com.google.common.collect.ImmutableList<String> options()
public abstract Optional<com.google.common.collect.ImmutableList<File>> classPath()
public final Compiler withProcessors(Processor... processors)
Note that most annotation processors cannot be reused for more than one compilation.
public final Compiler withProcessors(Iterable<? extends Processor> processors)
Note that most annotation processors cannot be reused for more than one compilation.
public final Compiler withOptions(Object... options)
public final Compiler withOptions(Iterable<?> options)
@Deprecated public final Compiler withClasspathFrom(ClassLoader classloader)
withClasspath(Iterable). This method only supports URLClassLoader and the default system classloader, and Files are usually a more
natural way to expression compilation classpaths than class loaders.IllegalArgumentException - if the given classloader had classpaths which we could not
determine or use for compilation.public final Compiler withClasspath(Iterable<File> classPath)
public final Compilation compile(JavaFileObject... files)
public final Compilation compile(Iterable<? extends JavaFileObject> files)
Copyright © 2013–2020. All rights reserved.