| /* |
| * Copyright 1999-2004 The Apache Software Foundation. |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| package org.apache.cocoon.components.language.programming; |
| |
| import org.apache.avalon.framework.component.Component; |
| |
| import java.io.IOException; |
| import java.util.List; |
| |
| /** |
| * This interface defines a compiler's functionality for all |
| * (Java-based) compiled languages |
| * |
| * @author <a href="mailto:stefano@apache.org">Stefano Mazzocchi</a> |
| * @version CVS $Id: LanguageCompiler.java,v 1.3 2004/03/05 13:02:48 bdelacretaz Exp $ |
| * @since 2.0 |
| */ |
| public interface LanguageCompiler extends Component { |
| |
| /** |
| * Set the name of the file containing the source program |
| * |
| * @param file The name of the file containing the source program |
| */ |
| void setFile(String file); |
| |
| /** |
| * Set the name of the directory containing the source program file |
| * |
| * @param srcDir The name of the directory containing the source program file |
| */ |
| void setSource(String srcDir); |
| |
| /** |
| * Set the name of the directory to contain the resulting object program file |
| * |
| * @param destDir The name of the directory to contain the resulting object |
| * program file |
| */ |
| void setDestination(String destDir); |
| |
| /** |
| * Set the classpath to be used for this compilation |
| * |
| * @param classpath The classpath to be used for this compilation |
| */ |
| void setClasspath(String classpath); |
| |
| /** |
| * Set the encoding of the input source file or <code>null</code> to use the |
| * platform's default encoding |
| * |
| * @param encoding The encoding of the input source file or <code>null</code> |
| * to use the platform's default encoding |
| */ |
| void setEncoding(String encoding); |
| |
| /** |
| * Compile a source file yielding a loadable program file. |
| * |
| * @exception IOException If an error occurs during compilation |
| */ |
| boolean compile() throws IOException; |
| |
| /** |
| * Return the list of errors generated by this compilation |
| * |
| * @return The list of errors generated by this compilation |
| * @exception IOException If an error occurs during message collection |
| */ |
| List getErrors() throws IOException; |
| } |