org.codehaus.plexus.compiler.javac

Class JavacCompiler


public class JavacCompiler
extends AbstractCompiler

Version:
$Id: JavacCompiler.java 3081 2006-03-22 06:55:18Z carlos $
Authors:
Trygve Laugstøl
Matthew Pocock
Others

Field Summary

private static String
WARNING_PREFIX

Constructor Summary

JavacCompiler()

Method Summary

static String[]
buildCompilerArguments(CompilerConfiguration config, String[] sourceFiles)
List
compile(CompilerConfiguration config)
(package private) List
compileInProcess(String[] args)
Compile the java sources in the current JVM, without calling an external executable, using com.sun.tools.javac.Main class
(package private) List
compileOutOfProcess(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 CompilerError
parseModernError(String error)
Construct a CompilerError object from a line of the compiler output
protected static List
parseModernStream(BufferedReader input)
Parse the output from the compiler into a list of CompilerError objects
private static boolean
suppressEncoding(CompilerConfiguration config)
private static boolean
suppressSource(CompilerConfiguration config)

Field Details

WARNING_PREFIX

private static final String WARNING_PREFIX

Constructor Details

JavacCompiler

public JavacCompiler()

Method Details

buildCompilerArguments

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

compile

public List compile(CompilerConfiguration config)
            throws CompilerException

compileInProcess

(package private)  List compileInProcess(String[] args)
            throws CompilerException
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.

compileOutOfProcess

(package private)  List compileOutOfProcess(File workingDirectory,
                                            String executable,
                                            String[] args)
            throws CompilerException
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.

createCommandLine

public String[] createCommandLine(CompilerConfiguration config)
            throws CompilerException

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)
            throws IOException
Parse the output from the compiler into a list of CompilerError objects
Parameters:
input - The output of the compiler
Returns:
List of CompilerError objects

suppressEncoding

private static boolean suppressEncoding(CompilerConfiguration config)

suppressSource

private static boolean suppressSource(CompilerConfiguration config)