Class AbstractCompiler
java.lang.Object
org.apache.axis.components.compiler.AbstractCompiler
- All Implemented Interfaces:
Compiler
This class implements the functionality common to all Java compilers.
- Since:
- 2.0
- Author:
- Davanum Srinivas, Stefano Mazzocchi
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringThe classpath to be used for compilationprotected StringThe name of the directory to contain the resulting object program fileprotected StringThe encoding of the source program ornullto use the platform's default encodingprotected InputStreamThe input stream to output compilation errorsprotected ArrayListThe source program filenamesprotected StringThe name of the directory containing the source program file -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the name of the file containing the source program to the file listprotected ListfillArguments(List arguments) Fill the arguments taken by the Java compilerReturn the list of errors generated by this compilationprotected abstract ListparseStream(BufferedReader errors) Parse the compiler error stream to produce a list ofCompilerErrorsvoidsetClasspath(String classpath) Set the classpath to be used for this compilationvoidsetDestination(String destDir) Set the name of the directory to contain the resulting object program filevoidsetEncoding(String encoding) Set the encoding of the input source file ornullto use the platform's default encodingvoidSet the name of the directory containing the source program fileprotected String[]toStringArray(List arguments) Copy arguments to a string array
-
Field Details
-
fileList
The source program filenames -
srcDir
The name of the directory containing the source program file -
destDir
The name of the directory to contain the resulting object program file -
classpath
The classpath to be used for compilation -
encoding
The encoding of the source program ornullto use the platform's default encoding -
errors
The input stream to output compilation errors
-
-
Constructor Details
-
AbstractCompiler
public AbstractCompiler()
-
-
Method Details
-
addFile
Add the name of the file containing the source program to the file list -
setSource
Set the name of the directory containing the source program file -
setDestination
Set the name of the directory to contain the resulting object program file- Specified by:
setDestinationin interfaceCompiler- Parameters:
destDir- The name of the directory to contain the resulting object program file
-
setClasspath
Set the classpath to be used for this compilation- Specified by:
setClasspathin interfaceCompiler- Parameters:
classpath- The classpath to be used for this compilation
-
setEncoding
Set the encoding of the input source file ornullto use the platform's default encoding- Specified by:
setEncodingin interfaceCompiler- Parameters:
encoding- The encoding of the input source file ornullto use the platform's default encoding
-
getErrors
Return the list of errors generated by this compilation- Specified by:
getErrorsin interfaceCompiler- Returns:
- The list of errors generated by this compilation
- Throws:
IOException- If an error occurs during message collection
-
parseStream
Parse the compiler error stream to produce a list ofCompilerErrors- Parameters:
errors- The error stream- Returns:
- The list of compiler error messages
- Throws:
IOException- If an error occurs during message collection
-
fillArguments
Fill the arguments taken by the Java compiler- Parameters:
arguments- The list of compilation arguments- Returns:
- The prepared list of compilation arguments
-
toStringArray
Copy arguments to a string array- Parameters:
arguments- The compiler arguments- Returns:
- A string array containing compilation arguments
-