KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cocoon > components > language > programming > LanguageCompiler


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.cocoon.components.language.programming;
17
18 import org.apache.avalon.framework.component.Component;
19
20 import java.io.IOException JavaDoc;
21 import java.util.List JavaDoc;
22
23 /**
24  * This interface defines a compiler's functionality for all
25  * (Java-based) compiled languages
26  *
27  * @author <a HREF="mailto:stefano@apache.org">Stefano Mazzocchi</a>
28  * @version CVS $Id: LanguageCompiler.java 156602 2005-03-09 03:55:53Z antonio $
29  * @since 2.0
30  */

31 public interface LanguageCompiler extends Component {
32
33     /**
34      * Set the name of the file containing the source program
35      *
36      * @param file The name of the file containing the source program
37      */

38     void setFile(String JavaDoc file);
39
40     /**
41      * Set the name of the directory containing the source program file
42      *
43      * @param srcDir The name of the directory containing the source program file
44      */

45     void setSource(String JavaDoc srcDir);
46
47     /**
48      * Set the name of the directory to contain the resulting object program file
49      *
50      * @param destDir The name of the directory to contain the resulting object
51      * program file
52      */

53     void setDestination(String JavaDoc destDir);
54
55     /**
56      * Set the classpath to be used for this compilation
57      *
58      * @param classpath The classpath to be used for this compilation
59      */

60     void setClasspath(String JavaDoc classpath);
61
62     /**
63      * Set the encoding of the input source file or <code>null</code> to use the
64      * platform's default encoding
65      *
66      * @param encoding The encoding of the input source file or <code>null</code>
67      * to use the platform's default encoding
68      */

69     void setEncoding(String JavaDoc encoding);
70
71     /**
72      * Set the version of the java source code to be compiled
73      *
74      * @param level The version of the JVM for wich the code was written.
75      * i.e: Posible level's values are:
76      * 130 = for Java 1.3, 140 = for Java 1.4 and 150 = for Java 1.5
77      *
78      * @since 2.1.7
79      */

80     void setCompilerComplianceLevel(int level);
81     
82     /**
83      * Compile a source file yielding a loadable program file.
84      *
85      * @exception IOException If an error occurs during compilation
86      */

87     boolean compile() throws IOException JavaDoc;
88
89     /**
90      * Return the list of errors generated by this compilation
91      *
92      * @return The list of errors generated by this compilation
93      * @exception IOException If an error occurs during message collection
94      */

95     List JavaDoc getErrors() throws IOException JavaDoc;
96 }
97
Popular Tags