|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.cocoon.components.language.programming.AbstractProgrammingLanguage
public abstract class AbstractProgrammingLanguage
Base implementation of ProgrammingLanguage. This class sets the
CodeFormatter instance and deletes source program files after
unloading.
| Field Summary | |
|---|---|
protected Class |
codeFormatter
The source code formatter |
protected String |
languageName
|
| Fields inherited from interface org.apache.cocoon.components.language.programming.ProgrammingLanguage |
|---|
ROLE |
| Constructor Summary | |
|---|---|
AbstractProgrammingLanguage()
|
|
| Method Summary | |
|---|---|
protected abstract void |
doUnload(Object program,
String filename,
File baseDirectory)
Unload a previously loaded program |
CodeFormatter |
getCodeFormatter()
Return this language's source code formatter. |
String |
getLanguageName()
Get Language Name |
CompiledComponent |
instantiate(Program program)
Create a new instance for the given class |
void |
parameterize(Parameters params)
Set the configuration parameters. |
void |
setLanguageName(String name)
Set Language Name |
void |
unload(Object program,
String filename,
File baseDirectory)
Unload from memory and invalidate a given program |
| 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, load, preload, quoteString |
| Field Detail |
|---|
protected Class codeFormatter
protected String languageName
| Constructor Detail |
|---|
public AbstractProgrammingLanguage()
| Method Detail |
|---|
public void parameterize(Parameters params)
throws ParameterException
parameterize in interface Parameterizableparams - The configuration parameters
ParameterException - If the language compiler cannot be loadedpublic CodeFormatter getCodeFormatter()
getCodeFormatter in interface ProgrammingLanguage
protected abstract void doUnload(Object program,
String filename,
File baseDirectory)
throws LanguageException
program - A previously loaded object program
LanguageException - If an error occurs during unloading
public final void unload(Object program,
String filename,
File baseDirectory)
throws LanguageException
ProgrammingLanguage
unload in interface ProgrammingLanguageprogram - The programfilename - The name of the file this program was loaded frombaseDirectory - The directory containing the program file
LanguageException - If an error occurspublic final void setLanguageName(String name)
ProgrammingLanguage
setLanguageName in interface ProgrammingLanguagename - The name of the languagepublic final String getLanguageName()
ProgrammingLanguage
getLanguageName in interface ProgrammingLanguage
public CompiledComponent instantiate(Program program)
throws LanguageException
instantiate in interface ProgrammingLanguageprogram - The Java class
LanguageException - If an instantiation error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||