|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.logger.AbstractLoggable | +--org.apache.cocoon.components.language.programming.java.AbstractJavaCompiler
This class implements the functionality common to all Java compilers.
Field Summary | |
protected java.lang.String |
classpath
The classpath to be used for compilation |
protected java.lang.String |
destDir
The name of the directory to contain the resulting object program file |
protected java.lang.String |
encoding
The encoding of the source program or null to use the
platform's default encoding |
protected java.io.InputStream |
errors
The input stream to output compilation errors |
protected java.lang.String |
file
The source program filename |
protected java.lang.String |
srcDir
The name of the directory containing the source program file |
Constructor Summary | |
AbstractJavaCompiler()
|
Method Summary | |
protected java.util.List |
fillArguments(java.util.List arguments)
Fill the arguments taken by the Java compiler |
java.util.List |
getErrors()
Return the list of errors generated by this compilation |
protected abstract java.util.List |
parseStream(java.io.BufferedReader errors)
Parse the compiler error stream to produce a list of CompilerError s |
void |
recycle()
Reset all internal state. |
void |
setClasspath(java.lang.String classpath)
Set the classpath to be used for this compilation |
void |
setDestination(java.lang.String destDir)
Set the name of the directory to contain the resulting object program file |
void |
setEncoding(java.lang.String encoding)
Set the encoding of the input source file or null to use the
platform's default encoding |
void |
setFile(java.lang.String file)
Set the name of the file containing the source program |
void |
setSource(java.lang.String srcDir)
Set the name of the directory containing the source program file |
protected java.lang.String[] |
toStringArray(java.util.List arguments)
Copy arguments to a string array |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable |
getLogger, setLogger, 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 java.lang.String file
protected java.lang.String srcDir
protected java.lang.String destDir
protected java.lang.String classpath
protected java.lang.String encoding
null
to use the
platform's default encodingprotected java.io.InputStream errors
Constructor Detail |
public AbstractJavaCompiler()
Method Detail |
public void setFile(java.lang.String file)
setFile
in interface LanguageCompiler
file
- The name of the file containing the source programpublic void setSource(java.lang.String srcDir)
setSource
in interface LanguageCompiler
srcDir
- The name of the directory containing the source program filepublic void setDestination(java.lang.String destDir)
setDestination
in interface LanguageCompiler
destDir
- The name of the directory to contain the resulting object
program filepublic void setClasspath(java.lang.String classpath)
setClasspath
in interface LanguageCompiler
classpath
- The classpath to be used for this compilationpublic void setEncoding(java.lang.String encoding)
null
to use the
platform's default encodingsetEncoding
in interface LanguageCompiler
encoding
- The encoding of the input source file or null
to use the platform's default encodingpublic java.util.List getErrors() throws java.io.IOException
getErrors
in interface LanguageCompiler
java.io.IOException
- If an error occurs during message collectionprotected abstract java.util.List parseStream(java.io.BufferedReader errors) throws java.io.IOException
CompilerError
serrors
- The error streamjava.io.IOException
- If an error occurs during message collectionprotected java.util.List fillArguments(java.util.List arguments)
arguments
- The list of compilation argumentsprotected java.lang.String[] toStringArray(java.util.List arguments)
arguments
- The compiler argumentspublic void recycle()
recycle
in interface org.apache.avalon.excalibur.pool.Recyclable
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |