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.StringclasspathThe classpath to be used for compilationprotected java.lang.StringdestDirThe name of the directory to contain the resulting object program fileprotected java.lang.StringencodingThe encoding of the source program ornullto use the platform's default encodingprotected java.io.InputStreamerrorsThe input stream to output compilation errorsprotected java.util.ArrayListfileListThe source program filenamesprotected java.lang.StringsrcDirThe 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 voidaddFile(java.lang.String file)Add the name of the file containing the source program to the file listprotected java.util.ListfillArguments(java.util.List arguments)Fill the arguments taken by the Java compilerjava.util.ListgetErrors()Return the list of errors generated by this compilationprotected abstract java.util.ListparseStream(java.io.BufferedReader errors)Parse the compiler error stream to produce a list ofCompilerErrorsvoidsetClasspath(java.lang.String classpath)Set the classpath to be used for this compilationvoidsetDestination(java.lang.String destDir)Set the name of the directory to contain the resulting object program filevoidsetEncoding(java.lang.String encoding)Set the encoding of the input source file ornullto use the platform's default encodingvoidsetSource(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 ornullto 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:
setDestinationin 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:
setClasspathin 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 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
public java.util.List getErrors() throws java.io.IOExceptionReturn the list of errors generated by this compilation
-
parseStream
protected abstract java.util.List parseStream(java.io.BufferedReader errors) throws java.io.IOExceptionParse the compiler error stream to produce a list ofCompilerErrors- 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
-
-