edu.rice.cs.drjava.model.compiler
Interface CompilerInterface

All Known Implementing Classes:
CompilerProxy, NoCompilerAvailable, GJv6Compiler

public interface CompilerInterface

The minimum interface that a compiler must meet to be used by DrJava.

Version:
$Id: CompilerInterface.java,v 1.14 2002/09/02 21:24:11 csreis Exp $

Method Summary
 void addToBootClassPath(File s)
          This method allows us to set the JSR14 collections path across a class loader.
 CompilerError[] compile(File[] sourceRoots, File[] files)
          Compile the given files.
 CompilerError[] compile(File sourceRoot, File[] files)
          Compile the given files.
 String getName()
          Returns the name of this compiler, appropriate to show to the user.
 boolean isAvailable()
          Indicates whether this compiler is actually available.
 void setAllowAssertions(boolean allow)
          Sets whether to allow assertions in Java 1.4.
 void setExtraClassPath(String extraClassPath)
          Allows us to set the extra classpath for the compilers without referencing the config object in a loaded class file.
 String toString()
          Should return info about compiler, at least including name.
 

Method Detail

compile

public CompilerError[] compile(File sourceRoot,
                               File[] files)
Compile the given files.
Parameters:
files - Source files to compile.
sourceRoot - Source root directory, the base of the package structure.
Returns:
Array of errors that occurred. If no errors, should be zero length array (not null).

compile

public CompilerError[] compile(File[] sourceRoots,
                               File[] files)
Compile the given files.
Parameters:
files - Source files to compile.
sourceRoots - Array of source root directories, the base of the package structure for all files to compile.
Returns:
Array of errors that occurred. If no errors, should be zero length array (not null).

isAvailable

public boolean isAvailable()
Indicates whether this compiler is actually available. As in: Is it installed and located? This method should load the compiler class, which should hopefully prove whether the class can load. If this method returns true, the compile(java.io.File, java.io.File[]) method should not fail due to class not being found.

getName

public String getName()
Returns the name of this compiler, appropriate to show to the user.

toString

public String toString()
Should return info about compiler, at least including name.
Overrides:
toString in class Object

setExtraClassPath

public void setExtraClassPath(String extraClassPath)
Allows us to set the extra classpath for the compilers without referencing the config object in a loaded class file.

setAllowAssertions

public void setAllowAssertions(boolean allow)
Sets whether to allow assertions in Java 1.4. (Allows us not to reference the config object in a loaded class file.)

addToBootClassPath

public void addToBootClassPath(File s)
This method allows us to set the JSR14 collections path across a class loader. (cannot cast a loaded class to a subclass, so all compiler interfaces must have this method)