org.apache.axis.components.compiler

Class AbstractCompiler

public abstract class AbstractCompiler extends Object implements Compiler

This class implements the functionality common to all Java compilers.

Since: 2.0

Author: Davanum Srinivas Stefano Mazzocchi

Field Summary
protected Stringclasspath
The classpath to be used for compilation
protected StringdestDir
The name of the directory to contain the resulting object program file
protected Stringencoding
The encoding of the source program or null to use the platform's default encoding
protected InputStreamerrors
The input stream to output compilation errors
protected ArrayListfileList
The source program filenames
protected StringsrcDir
The name of the directory containing the source program file
Method Summary
voidaddFile(String file)
Add the name of the file containing the source program to the file list
protected ListfillArguments(List arguments)
Fill the arguments taken by the Java compiler
ListgetErrors()
Return the list of errors generated by this compilation
protected abstract ListparseStream(BufferedReader errors)
Parse the compiler error stream to produce a list of CompilerErrors
voidsetClasspath(String classpath)
Set the classpath to be used for this compilation
voidsetDestination(String destDir)
Set the name of the directory to contain the resulting object program file
voidsetEncoding(String encoding)
Set the encoding of the input source file or null to use the platform's default encoding
voidsetSource(String srcDir)
Set the name of the directory containing the source program file
protected String[]toStringArray(List arguments)
Copy arguments to a string array

Field Detail

classpath

protected String classpath
The classpath to be used for compilation

destDir

protected String destDir
The name of the directory to contain the resulting object program file

encoding

protected String encoding
The encoding of the source program or null to use the platform's default encoding

errors

protected InputStream errors
The input stream to output compilation errors

fileList

protected ArrayList fileList
The source program filenames

srcDir

protected String srcDir
The name of the directory containing the source program file

Method Detail

addFile

public void addFile(String file)
Add the name of the file containing the source program to the file list

Parameters: file The name of the file containing the source program

fillArguments

protected List fillArguments(List arguments)
Fill the arguments taken by the Java compiler

Parameters: arguments The list of compilation arguments

Returns: The prepared list of compilation arguments

getErrors

public List getErrors()
Return the list of errors generated by this compilation

Returns: The list of errors generated by this compilation

Throws: IOException If an error occurs during message collection

parseStream

protected abstract List parseStream(BufferedReader errors)
Parse the compiler error stream to produce a list of CompilerErrors

Parameters: errors The error stream

Returns: The list of compiler error messages

Throws: IOException If an error occurs during message collection

setClasspath

public void setClasspath(String classpath)
Set the classpath to be used for this compilation

Parameters: classpath The classpath to be used for this compilation

setDestination

public void setDestination(String destDir)
Set the name of the directory to contain the resulting object program file

Parameters: destDir The name of the directory to contain the resulting object program file

setEncoding

public void setEncoding(String encoding)
Set the encoding of the input source file or null to use the platform's default encoding

Parameters: encoding The encoding of the input source file or null to use the platform's default encoding

setSource

public void setSource(String srcDir)
Set the name of the directory containing the source program file

Parameters: srcDir The name of the directory containing the source program file

toStringArray

protected String[] toStringArray(List arguments)
Copy arguments to a string array

Parameters: arguments The compiler arguments

Returns: A string array containing compilation arguments

Copyright B) 2005 Apache Web Services Project. All Rights Reserved.