Methods Summary |
---|
public void | addFile(java.lang.String file)Add the name of the file containing the source program to the file list
this.fileList.add(file);
|
protected java.util.List | fillArguments(java.util.List arguments)Fill the arguments taken by the Java compiler
// destination directory
arguments.add("-d");
arguments.add(destDir);
// classpath
arguments.add("-classpath");
arguments.add(classpath);
// sourcepath
if(srcDir != null) {
arguments.add("-sourcepath");
arguments.add(srcDir);
}
// add optimization (for what is worth)
arguments.add("-O");
// add debug option
arguments.add("-g");
// add encoding if set
if (encoding != null) {
arguments.add("-encoding");
arguments.add(encoding);
}
return arguments;
|
public java.util.List | getErrors()Return the list of errors generated by this compilation
return parseStream(new BufferedReader(new InputStreamReader(errors)));
|
protected abstract java.util.List | parseStream(java.io.BufferedReader errors)Parse the compiler error stream to produce a list of
CompilerError s
|
public void | setClasspath(java.lang.String classpath)Set the classpath to be used for this compilation
this.classpath = classpath;
|
public void | setDestination(java.lang.String destDir)Set the name of the directory to contain the resulting object program file
this.destDir = destDir;
|
public void | setEncoding(java.lang.String encoding)Set the encoding of the input source file or null to use the
platform's default encoding
this.encoding = encoding;
|
public void | setSource(java.lang.String srcDir)Set the name of the directory containing the source program file
this.srcDir = srcDir;
|
protected java.lang.String[] | toStringArray(java.util.List arguments)Copy arguments to a string array
int i;
String[] args = new String[arguments.size() + fileList.size()];
for (i = 0; i < arguments.size(); i++) {
args[i] = (String) arguments.get(i);
}
for (int j=0; j < fileList.size(); i++,j++) {
args[i] = (String)fileList.get(j);
}
return args;
|