KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > components > compiler > Compiler


1 /*
2  * Copyright 2001-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
17 package org.apache.axis.components.compiler;
18
19 import java.io.IOException JavaDoc;
20 import java.util.List JavaDoc;
21
22 /**
23  * This interface defines a compiler's functionality for all
24  * (Java-based) compiled languages
25  * @author <a HREF="mailto:dims@yahoo.com">Davanum Srinivas</a>
26  * @author <a HREF="mailto:stefano@apache.org">Stefano Mazzocchi</a>
27  * @since 2.0
28  */

29 public interface Compiler {
30   /**
31    * Set the name of the file containing the source program
32    *
33    * @param file The name of the file containing the source program
34    */

35   void addFile(String JavaDoc file);
36
37   /**
38    * Set the name of the directory containing the source program file
39    *
40    * @param srcDir The name of the directory containing the source program file
41    */

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

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

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

66   void setEncoding(String JavaDoc encoding);
67
68   /**
69    * Compile a source file yielding a loadable program file.
70    *
71    * @param filename The object program base file name
72    * @param baseDirectory The directory containing the object program file
73    * @param encoding The encoding expected in the source file or
74    * <code>null</code> if it is the platform's default encoding
75    * @exception LanguageException If an error occurs during compilation
76    */

77   boolean compile() throws IOException JavaDoc;
78
79   /**
80    * Return the list of errors generated by this compilation
81    *
82    * @return The list of errors generated by this compilation
83    * @exception IOException If an error occurs during message collection
84    */

85   List JavaDoc getErrors() throws IOException JavaDoc;
86 }
87
Popular Tags