org.codehaus.plexus.compiler.javac

Class JavacCompiler

public class JavacCompiler extends AbstractCompiler

Version: $Id: JavacCompiler.java 3081 2006-03-22 06:55:18Z carlos $

Author: Trygve Laugstøl Matthew Pocock Others

Field Summary
static StringWARNING_PREFIX
Constructor Summary
JavacCompiler()
Method Summary
static String[]buildCompilerArguments(CompilerConfiguration config, String[] sourceFiles)
Listcompile(CompilerConfiguration config)
ListcompileInProcess(String[] args)
Compile the java sources in the current JVM, without calling an external executable, using com.sun.tools.javac.Main class
ListcompileOutOfProcess(File workingDirectory, String executable, String[] args)
Compile the java sources in a external process, calling an external executable, like javac.
String[]createCommandLine(CompilerConfiguration config)
static CompilerErrorparseModernError(String error)
Construct a CompilerError object from a line of the compiler output
protected static ListparseModernStream(BufferedReader input)
Parse the output from the compiler into a list of CompilerError objects
static booleansuppressEncoding(CompilerConfiguration config)
static booleansuppressSource(CompilerConfiguration config)

Field Detail

WARNING_PREFIX

private static final String WARNING_PREFIX

Constructor Detail

JavacCompiler

public JavacCompiler()

Method Detail

buildCompilerArguments

public static String[] buildCompilerArguments(CompilerConfiguration config, String[] sourceFiles)

compile

public List compile(CompilerConfiguration config)

compileInProcess

List compileInProcess(String[] args)
Compile the java sources in the current JVM, without calling an external executable, using com.sun.tools.javac.Main class

Parameters: args arguments for the compiler as they would be used in the command line javac

Returns: List of CompilerError objects with the errors encountered.

Throws: CompilerException

compileOutOfProcess

List compileOutOfProcess(File workingDirectory, String executable, String[] args)
Compile the java sources in a external process, calling an external executable, like javac.

Parameters: workingDirectory base directory where the process will be launched executable name of the executable to launch args arguments for the executable launched

Returns: List of CompilerError objects with the errors encountered.

Throws: CompilerException

createCommandLine

public String[] createCommandLine(CompilerConfiguration config)

parseModernError

public static CompilerError parseModernError(String error)
Construct a CompilerError object from a line of the compiler output

Parameters: error output line from the compiler

Returns: the CompilerError object

parseModernStream

protected static List parseModernStream(BufferedReader input)
Parse the output from the compiler into a list of CompilerError objects

Parameters: input The output of the compiler

Returns: List of CompilerError objects

Throws: IOException

suppressEncoding

private static boolean suppressEncoding(CompilerConfiguration config)

suppressSource

private static boolean suppressSource(CompilerConfiguration config)