org.apache.cocoon.components.language.programming
Interface LanguageCompiler

All Superinterfaces:
Component
All Known Implementing Classes:
AbstractJavaCompiler, EclipseJavaCompiler, Javac, Jikes, Pizza

public interface LanguageCompiler
extends Component

This interface defines a compiler's functionality for all (Java-based) compiled languages

Since:
2.0
Version:
CVS $Id: LanguageCompiler.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Stefano Mazzocchi

Method Summary
 boolean compile()
          Compile a source file yielding a loadable program file.
 List getErrors()
          Return the list of errors generated by this compilation
 void setClasspath(String classpath)
          Set the classpath to be used for this compilation
 void setCompilerComplianceLevel(int level)
          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
 

Method Detail

setFile

void setFile(String file)
Set the name of the file containing the source program

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

setSource

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

setDestination

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

setClasspath

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

Parameters:
classpath - The classpath to be used for this compilation

setEncoding

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

setCompilerComplianceLevel

void setCompilerComplianceLevel(int level)
Set the version of the java source code to be compiled

Parameters:
level - The version of the JVM for wich the code was written. i.e: Posible level's values are: 130 = for Java 1.3, 140 = for Java 1.4 and 150 = for Java 1.5
Since:
2.1.7

compile

boolean compile()
                throws IOException
Compile a source file yielding a loadable program file.

Throws:
IOException - If an error occurs during compilation

getErrors

List getErrors()
               throws IOException
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


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.