|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.components.language.programming.java.AbstractJavaCompiler
public abstract class AbstractJavaCompiler
This class implements the functionality common to all Java compilers.
Field Summary | |
---|---|
protected String |
classpath
The classpath to be used for compilation |
protected int |
compilerComplianceLevel
The version of the JVM for wich the code was written. |
protected String |
destDir
The name of the directory to contain the resulting object program file |
protected String |
encoding
The encoding of the source program or null to use the
platform's default encoding |
protected InputStream |
errors
The input stream to output compilation errors |
protected String |
file
The source program filename |
protected String |
srcDir
The name of the directory containing the source program file |
Constructor Summary | |
---|---|
AbstractJavaCompiler()
|
Method Summary | |
---|---|
protected List |
fillArguments(List arguments)
Fill the arguments taken by the Java compiler |
List |
getErrors()
Return the list of errors generated by this compilation |
protected abstract List |
parseStream(BufferedReader errors)
Parse the compiler error stream to produce a list of CompilerError s |
void |
recycle()
Reset all internal state. |
void |
setClasspath(String classpath)
Set the classpath to be used for this compilation |
void |
setCompilerComplianceLevel(int compilerComplianceLevel)
Set the version of the java source code to be compiled |
void |
setDestination(String destDir)
Set the name of the directory to contain the resulting object program file |
void |
setEncoding(String encoding)
Set the encoding of the input source file or null to use the
platform's default encoding |
void |
setFile(String file)
Set the name of the file containing the source program |
void |
setSource(String srcDir)
Set the name of the directory containing the source program file |
protected String[] |
toStringArray(List arguments)
Copy arguments to a string array |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.cocoon.components.language.programming.LanguageCompiler |
---|
compile |
Field Detail |
---|
protected String file
protected String srcDir
protected String destDir
protected String classpath
protected String encoding
null
to use the
platform's default encoding
protected int compilerComplianceLevel
protected InputStream errors
Constructor Detail |
---|
public AbstractJavaCompiler()
Method Detail |
---|
public void setFile(String file)
setFile
in interface LanguageCompiler
file
- The name of the file containing the source programpublic void setSource(String srcDir)
setSource
in interface LanguageCompiler
srcDir
- The name of the directory containing the source program filepublic void setDestination(String destDir)
setDestination
in interface LanguageCompiler
destDir
- The name of the directory to contain the resulting object
program filepublic void setClasspath(String classpath)
setClasspath
in interface LanguageCompiler
classpath
- The classpath to be used for this compilationpublic void setEncoding(String encoding)
null
to use the
platform's default encoding
setEncoding
in interface LanguageCompiler
encoding
- The encoding of the input source file or null
to use the platform's default encodingpublic void setCompilerComplianceLevel(int compilerComplianceLevel)
setCompilerComplianceLevel
in interface LanguageCompiler
compilerComplianceLevel
- The version of the JVM for wich the code was written.
i.e: 130 = Java 1.3, 140 = Java 1.4 and 150 = Java 1.5public List getErrors() throws IOException
getErrors
in interface LanguageCompiler
IOException
- If an error occurs during message collectionprotected abstract List parseStream(BufferedReader errors) throws IOException
CompilerError
s
errors
- The error stream
IOException
- If an error occurs during message collectionprotected List fillArguments(List arguments)
arguments
- The list of compilation arguments
protected String[] toStringArray(List arguments)
arguments
- The compiler arguments
public void recycle()
recycle
in interface Recyclable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |