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 String
The classpath to be used for compilationprotected String
The name of the directory to contain the resulting object program fileprotected String
The encoding of the source program ornull
to use the platform's default encodingprotected InputStream
The input stream to output compilation errorsprotected ArrayList
The source program filenamesprotected String
The name of the directory containing the source program file -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the name of the file containing the source program to the file listprotected List
fillArguments
(List arguments) Fill the arguments taken by the Java compilerReturn the list of errors generated by this compilationprotected abstract List
parseStream
(BufferedReader errors) Parse the compiler error stream to produce a list ofCompilerError
svoid
setClasspath
(String classpath) Set the classpath to be used for this compilationvoid
setDestination
(String destDir) Set the name of the directory to contain the resulting object program filevoid
setEncoding
(String encoding) Set the encoding of the input source file ornull
to use the platform's default encodingvoid
Set 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 ornull
to 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:
setDestination
in 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:
setClasspath
in interfaceCompiler
- Parameters:
classpath
- The classpath to be used for this compilation
-
setEncoding
Set the encoding of the input source file ornull
to use the platform's default encoding- Specified by:
setEncoding
in interfaceCompiler
- Parameters:
encoding
- The encoding of the input source file ornull
to use the platform's default encoding
-
getErrors
Return the list of errors generated by this compilation- Specified by:
getErrors
in 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 ofCompilerError
s- 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
-