public abstract class AbstractCompiler extends Object implements Compiler
Modifier and Type | Field and Description |
---|---|
protected String |
classpath
The classpath to be used for compilation
|
protected String |
destDir
The name of the directory to contain the resulting object program file
|
protected String |
encoding
The encoding of the source program or
null to use the
platform's default encoding |
protected InputStream |
errors
The input stream to output compilation errors
|
protected ArrayList |
fileList
The source program filenames
|
protected String |
srcDir
The name of the directory containing the source program file
|
Constructor and Description |
---|
AbstractCompiler() |
Modifier and Type | Method and Description |
---|---|
void |
addFile(String file)
Add the name of the file containing the source program to the file list
|
protected List |
fillArguments(List arguments)
Fill the arguments taken by the Java compiler
|
List |
getErrors()
Return the list of errors generated by this compilation
|
protected abstract List |
parseStream(BufferedReader errors)
Parse the compiler error stream to produce a list of
CompilerError s |
void |
setClasspath(String classpath)
Set the classpath to be used for this compilation
|
void |
setDestination(String destDir)
Set the name of the directory to contain the resulting object program file
|
void |
setEncoding(String encoding)
Set the encoding of the input source file or
null to use the
platform's default encoding |
void |
setSource(String srcDir)
Set the name of the directory containing the source program file
|
protected String[] |
toStringArray(List arguments)
Copy arguments to a string array
|
protected ArrayList fileList
protected String srcDir
protected String destDir
protected String classpath
protected String encoding
null
to use the
platform's default encodingprotected InputStream errors
public void addFile(String file)
public void setSource(String srcDir)
public void setDestination(String destDir)
setDestination
in interface Compiler
destDir
- The name of the directory to contain the resulting object
program filepublic void setClasspath(String classpath)
setClasspath
in interface Compiler
classpath
- The classpath to be used for this compilationpublic void setEncoding(String encoding)
null
to use the
platform's default encodingsetEncoding
in interface Compiler
encoding
- The encoding of the input source file or null
to use the platform's default encodingpublic List getErrors() throws IOException
getErrors
in interface Compiler
IOException
- If an error occurs during message collectionprotected abstract List parseStream(BufferedReader errors) throws IOException
CompilerError
serrors
- The error streamIOException
- If an error occurs during message collectionprotected List fillArguments(List arguments)
arguments
- The list of compilation argumentsCopyright © The Apache Software Foundation. All Rights Reserved.