| java.lang.Object edu.rice.cs.drjava.model.compiler.DefaultCompilerModel
DefaultCompilerModel | public class DefaultCompilerModel implements CompilerModel(Code) | | Default implementation of the CompilerModel interface. This implementation is used for normal DrJava execution
(as opposed to testing DrJava).
version: $Id: DefaultCompilerModel.java 4255 2007-08-28 19:17:37Z mgricken $ |
DefaultCompilerModel | public DefaultCompilerModel(GlobalModel m, Iterable<? extends CompilerInterface> compilers)(Code) | | Main constructor.
Parameters: m - the GlobalModel that is the source of documents for this CompilerModel Parameters: compilers - The compilers to use. The first will be made active; all are assumedto be available. An empty list is acceptable. |
addListener | public void addListener(CompilerListener listener)(Code) | | Add a CompilerListener to the model.
Parameters: listener - a listener that reacts to compiler eventsThis operation is synchronized by the readers/writers protocol in EventNotifier. |
compile | public void compile(List<OpenDefinitionsDocument> defDocs) throws IOException(Code) | | Compiles all of the given files.
Before compiling, all unsaved and untitled documents are saved, and compilation ends if the user cancels this
step. The compilation classpath and sourcepath includes the build directory (if it exists), the source roots,
the project "extra classpath" (if it exists), the global "extra classpath", and the current JVM's classpath
(which includes drjava.jar, containing JUnit classes).
This method formerly only compiled documents which were out of sync with their class file, as a performance
optimization. However, bug #634386 pointed out that unmodified files could depend on modified files, in which
case this command would not recompile a file in some situations when it should. Since we value correctness over
performance, we now always compile all open documents.
throws: IOException - if a filesystem-related problem prevents compilation |
compile | public void compile(OpenDefinitionsDocument doc) throws IOException(Code) | | Compiles the given file.
Before compiling, all unsaved and untitled documents are saved, and compilation ends if the user cancels this
step. The compilation classpath and sourcepath includes the build directory (if it exists), the source roots,
the project "extra classpath" (if it exists), the global "extra classpath", and the current JVM's classpath
(which includes drjava.jar, containing JUnit classes).
This method formerly only compiled documents which were out of sync with their class file, as a performance
optimization. However, bug #634386 pointed out that unmodified files could depend on modified files, in which
case this command would not recompile a file in some situations when it should. Since we value correctness over
performance, we now always compile all open documents.
throws: IOException - if a filesystem-related problem prevents compilation |
compileAll | public void compileAll() throws IOException(Code) | | Compile all open documents.
Before compiling, all unsaved and untitled documents are saved, and compilation ends if the user cancels this
step. The compilation classpath and sourcepath includes the build directory (if it exists), the source roots,
the project "extra classpath" (if it exists), the global "extra classpath", and the current JVM's classpath
(which includes drjava.jar, containing JUnit classes).
This method formerly only compiled documents which were out of sync with their class file, as a performance
optimization. However, bug #634386 pointed out that unmodified files could depend on modified files, in which
case this command would not recompile a file in some situations when it should. Since we value correctness over
performance, we now always compile all open documents.
throws: IOException - if a filesystem-related problem prevents compilation |
compileProject | public void compileProject() throws IOException(Code) | | Compiles all documents in the project source tree. Assumes DrJava currently contains an active project.
Before compiling, all unsaved and untitled documents are saved, and compilation ends if the user cancels this
step. The compilation classpath and sourcepath includes the build directory (if it exists), the source roots,
the project "extra classpath" (if it exists), the global "extra classpath", and the current JVM's classpath
(which includes drjava.jar, containing JUnit classes).
This method formerly only compiled documents which were out of sync with their class file, as a performance
optimization. However, bug #634386 pointed out that unmodified files could depend on modified files, in which
case this command would not recompile a file in some situations when it should. Since we value correctness over
performance, we now always compile all open documents.
throws: IOException - if a filesystem-related problem prevents compilation |
getCompilerErrorModel | public CompilerErrorModel getCompilerErrorModel()(Code) | | Gets the CompilerErrorModel representing the last compile.
|
getCompilerLock | public Object getCompilerLock()(Code) | | Returns the lock used to prevent simultaneous compilation and JUnit testing
|
getNumCompErrors | public int getNumCompErrors()(Code) | | Gets the total number of current compiler errors.
|
getNumErrors | public int getNumErrors()(Code) | | Gets the total number of errors in this compiler model.
|
getNumWarnings | public int getNumWarnings()(Code) | | Gets the total number of current warnings.
|
removeAllListeners | public void removeAllListeners()(Code) | | Removes all CompilerListeners from this model.
|
removeListener | public void removeListener(CompilerListener listener)(Code) | | Remove a CompilerListener from the model. If the listener is not currently
listening to this model, this method has no effect.
Parameters: listener - a listener that reacts to compiler eventsThis operation is synchronized by the readers/writers protocol in EventNotifier. |
resetCompilerErrors | public void resetCompilerErrors()(Code) | | Resets the compiler error state to have no errors.
|
|
|