Class AbstractCompiler
- java.lang.Object
-
- org.apache.axis.components.compiler.AbstractCompiler
-
- All Implemented Interfaces:
Compiler
public abstract class AbstractCompiler extends java.lang.Object implements Compiler
This class implements the functionality common to all Java compilers.- Since:
- 2.0
- Author:
- Davanum Srinivas, Stefano Mazzocchi
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
classpath
The classpath to be used for compilationprotected java.lang.String
destDir
The name of the directory to contain the resulting object program fileprotected java.lang.String
encoding
The encoding of the source program ornull
to use the platform's default encodingprotected java.io.InputStream
errors
The input stream to output compilation errorsprotected java.util.ArrayList
fileList
The source program filenamesprotected java.lang.String
srcDir
The name of the directory containing the source program file
-
Constructor Summary
Constructors Constructor Description AbstractCompiler()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addFile(java.lang.String file)
Add the name of the file containing the source program to the file listprotected java.util.List
fillArguments(java.util.List arguments)
Fill the arguments taken by the Java compilerjava.util.List
getErrors()
Return the list of errors generated by this compilationprotected abstract java.util.List
parseStream(java.io.BufferedReader errors)
Parse the compiler error stream to produce a list ofCompilerError
svoid
setClasspath(java.lang.String classpath)
Set the classpath to be used for this compilationvoid
setDestination(java.lang.String destDir)
Set the name of the directory to contain the resulting object program filevoid
setEncoding(java.lang.String encoding)
Set the encoding of the input source file ornull
to use the platform's default encodingvoid
setSource(java.lang.String srcDir)
Set the name of the directory containing the source program fileprotected java.lang.String[]
toStringArray(java.util.List arguments)
Copy arguments to a string array
-
-
-
Field Detail
-
fileList
protected java.util.ArrayList fileList
The source program filenames
-
srcDir
protected java.lang.String srcDir
The name of the directory containing the source program file
-
destDir
protected java.lang.String destDir
The name of the directory to contain the resulting object program file
-
classpath
protected java.lang.String classpath
The classpath to be used for compilation
-
encoding
protected java.lang.String encoding
The encoding of the source program ornull
to use the platform's default encoding
-
errors
protected java.io.InputStream errors
The input stream to output compilation errors
-
-
Method Detail
-
addFile
public void addFile(java.lang.String file)
Add the name of the file containing the source program to the file list
-
setSource
public void setSource(java.lang.String srcDir)
Set the name of the directory containing the source program file
-
setDestination
public void setDestination(java.lang.String destDir)
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
public void setClasspath(java.lang.String classpath)
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
public void setEncoding(java.lang.String encoding)
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
public java.util.List getErrors() throws java.io.IOException
Return the list of errors generated by this compilation
-
parseStream
protected abstract java.util.List parseStream(java.io.BufferedReader errors) throws java.io.IOException
Parse the compiler error stream to produce a list ofCompilerError
s- Parameters:
errors
- The error stream- Returns:
- The list of compiler error messages
- Throws:
java.io.IOException
- If an error occurs during message collection
-
fillArguments
protected java.util.List fillArguments(java.util.List arguments)
Fill the arguments taken by the Java compiler- Parameters:
arguments
- The list of compilation arguments- Returns:
- The prepared list of compilation arguments
-
toStringArray
protected java.lang.String[] toStringArray(java.util.List arguments)
Copy arguments to a string array- Parameters:
arguments
- The compiler arguments- Returns:
- A string array containing compilation arguments
-
-