|
||||||||||
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.AbstractProgrammingLanguage org.apache.cocoon.components.language.programming.CompiledProgrammingLanguage
public abstract class CompiledProgrammingLanguage
A compiled programming language. This class extends AbstractProgrammingLanguage
adding support for compilation
and object program files
Field Summary | |
---|---|
protected String |
classpath
The local classpath |
protected Class |
compilerClass
The compiler |
protected boolean |
deleteSources
The source deletion option |
Fields inherited from class org.apache.cocoon.components.language.programming.AbstractProgrammingLanguage |
---|
codeFormatter, languageName |
Fields inherited from interface org.apache.cocoon.components.language.programming.ProgrammingLanguage |
---|
ROLE |
Constructor Summary | |
---|---|
CompiledProgrammingLanguage()
|
Method Summary | |
---|---|
protected abstract void |
compile(String filename,
File baseDirectory,
String encoding)
Compile a source file yielding a loadable object file. |
void |
contextualize(Context context)
Set the context |
abstract void |
doUnload(Object program)
Unload a previously loaded program |
protected void |
doUnload(Object program,
String filename,
File baseDirectory)
Unload a previously loaded program given its original filesystem location |
abstract String |
getObjectExtension()
Return the language's canonical object file extension. |
Program |
load(String filename,
File baseDirectory,
String encoding)
Load an object program from a file. |
protected abstract Class |
loadProgram(String filename,
File baseDirectory)
Actually load an object program from a file. |
void |
parameterize(Parameters params)
Set the configuration parameters. |
Program |
preload(String filename,
File baseDirectory,
String encoding)
Preload an object program from a file. |
Methods inherited from class org.apache.cocoon.components.language.programming.AbstractProgrammingLanguage |
---|
getCodeFormatter, getLanguageName, instantiate, setLanguageName, unload |
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.ProgrammingLanguage |
---|
getSourceExtension, quoteString |
Field Detail |
---|
protected Class compilerClass
protected String classpath
protected boolean deleteSources
Constructor Detail |
---|
public CompiledProgrammingLanguage()
Method Detail |
---|
public void parameterize(Parameters params) throws ParameterException
parameterize
in interface Parameterizable
parameterize
in class AbstractProgrammingLanguage
params
- The configuration parameters
ParameterException
- If the language compiler cannot be loadedpublic void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
context
- The context
ContextException
public abstract String getObjectExtension()
public abstract void doUnload(Object program) throws LanguageException
program
- A previously loaded object program
LanguageException
- If an error occurs during unloadingprotected final void doUnload(Object program, String filename, File baseDirectory) throws LanguageException
doUnload
in class AbstractProgrammingLanguage
program
- The previously loaded object programfilename
- The base filename of the object programbaseDirectory
- The directory contaning the object program file
LanguageException
- If an error occursprotected abstract Class loadProgram(String filename, File baseDirectory) throws LanguageException
filename
- The object program base file namebaseDirectory
- The directory containing the object program file
LanguageException
- If an error occurs during loadingprotected abstract void compile(String filename, File baseDirectory, String encoding) throws LanguageException
filename
- The object program base file namebaseDirectory
- The directory containing the object program fileencoding
- The encoding expected in the source file or null
if it is the platform's default encoding
LanguageException
- If an error occurs during compilationpublic Program preload(String filename, File baseDirectory, String encoding) throws LanguageException
preload
in interface ProgrammingLanguage
filename
- The object program base file namebaseDirectory
- The directory containing the object program fileencoding
- The encoding expected in the source file or null
if it is the platform's default encoding
LanguageException
- If an error occurs during compilationpublic Program load(String filename, File baseDirectory, String encoding) throws LanguageException
load
in interface ProgrammingLanguage
filename
- The object program base file namebaseDirectory
- The directory containing the object program fileencoding
- The encoding expected in the source file or null
if it is the platform's default encoding
LanguageException
- If an error occurs during compilation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |