Class Compiler
java.lang.Object
org.codehaus.commons.compiler.AbstractCompiler
org.codehaus.commons.compiler.jdk.Compiler
- All Implemented Interfaces:
ICompiler
javax.tools-based implementation of the ICompiler.-
Field Summary
Fields inherited from class org.codehaus.commons.compiler.AbstractCompiler
bootClassPath, classFileCreator, classFileFinder, classPath, compileErrorHandler, debugLines, debugSource, debugVars, extensionDirectories, sourceCharset, sourceFinder, sourceVersion, targetVersion, warningHandlerFields inherited from interface org.codehaus.commons.compiler.ICompiler
CREATE_NEXT_TO_SOURCE_FILE, FIND_NEXT_TO_SOURCE_FILE, NO_DESTINATION_DIRECTORY -
Constructor Summary
ConstructorsConstructorDescriptionCompiler()Compiler(JavaCompiler compiler) Initializes with a different,javax.tools.JavaCompiler-compatible Java compiler. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidsetCompilerOptions(String[] compilerOptions) Adds command line options that are passed unchecked to the.invalid reference
java.lang.CompilervoidsetVerbose(boolean verbose) Equivalent of-verbose.Methods inherited from class org.codehaus.commons.compiler.AbstractCompiler
compile, setBootClassPath, setCharacterEncoding, setClassFileCreator, setClassFileFinder, setClassFileFinder, setClassPath, setCompileErrorHandler, setDebugLines, setDebugSource, setDebugVars, setDestinationDirectory, setEncoding, setExtensionDirectories, setSourceCharset, setSourceFinder, setSourcePath, setSourceVersion, setTargetVersion, setWarningHandler
-
Constructor Details
-
Compiler
public Compiler() -
Compiler
Initializes with a different,javax.tools.JavaCompiler-compatible Java compiler.
-
-
Method Details
-
setVerbose
public void setVerbose(boolean verbose) Description copied from interface:ICompilerEquivalent of-verbose. -
setCompilerOptions
Adds command line options that are passed unchecked to the.invalid reference
java.lang.CompilerNotice: Don't use the '-g' options - these are controlled through
AbstractCompiler.setDebugLines(boolean),AbstractCompiler.setDebugVars(boolean)andAbstractCompiler.setDebugSource(boolean).- Parameters:
compilerOptions- All command line options supported by the JDK JAVAC tool
-
compile
Description copied from interface:ICompiler- Parameters:
sourceResources- Contain the compilation units to compile- Throws:
CompileExceptionIOException
-
compile
public void compile(Resource[] sourceResources, @Nullable SortedSet<Location> offsets) throws CompileException, IOException - Throws:
CompileExceptionIOException
-