edu.rice.cs.drjava.model.compiler
Class NoCompilerAvailable

java.lang.Object
  extended by edu.rice.cs.drjava.model.compiler.NoCompilerAvailable
All Implemented Interfaces:
CompilerInterface

public class NoCompilerAvailable
extends Object
implements CompilerInterface

A CompilerInterface implementation for signifying that no compiler is available.

Version:
$Id: NoCompilerAvailable.java 5395 2010-09-21 15:26:15Z mgricken $

Field Summary
private static String MESSAGE
           
static CompilerInterface ONLY
           
 
Constructor Summary
private NoCompilerAvailable()
           
 
Method Summary
 List<File> additionalBootClassPathForInteractions()
          A compiler can instruct DrJava to include additional elements for the boot class path of the Interactions JVM.
 List<? extends DJError> compile(List<? extends File> files, List<? extends File> classPath, List<? extends File> sourcePath, File destination, List<? extends File> bootClassPath, String sourceVersion, boolean showWarnings)
          Compile the given files.
 String getDescription()
          Returns a one-line description of the compiler (such as the name and file location)
 FileFilter getFileFilter()
          Return a file filter that can be used to open files this compiler supports.
 Set<String> getKeywordsForFile(File f)
          Return the set of keywords that should be highlighted in the specified file.
 String getName()
          Returns the name of this compiler, appropriate to show to the user.
 String getOpenAllFilesInFolderExtension()
          Return the extension of the files that should be opened with the "Open Folder..." command.
 Set<String> getSourceFileExtensions()
          Return the set of source file extensions that this compiler supports.
 String getSuggestedFileExtension()
          Return the suggested file extension that will be appended to a file without extension.
 boolean isAvailable()
          Indicates whether this compiler is actually available.
 boolean isSourceFileForThisCompiler(File f)
          Always false
 boolean supportsLanguageLevels()
          Return true if this compiler can be used in conjunction with the language level facility.
 String toString()
          The toString() of this class is displayed in the "Compiler" drop down on the compiler tab.
 String transformCommands(String interactionsString)
          Transform the command line to be interpreted into something the Interactions JVM can use.
 JavaVersion version()
          The latest version of Java supported by the compiler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ONLY

public static final CompilerInterface ONLY

MESSAGE

private static final String MESSAGE
See Also:
Constant Field Values
Constructor Detail

NoCompilerAvailable

private NoCompilerAvailable()
Method Detail

isAvailable

public boolean isAvailable()
Description copied from interface: CompilerInterface
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 CompilerInterface.compile(java.util.List, java.util.List, java.util.List, java.io.File, java.util.List, java.lang.String, boolean) method should not fail due to class not being found.

Specified by:
isAvailable in interface CompilerInterface

compile

public List<? extends DJError> compile(List<? extends File> files,
                                       List<? extends File> classPath,
                                       List<? extends File> sourcePath,
                                       File destination,
                                       List<? extends File> bootClassPath,
                                       String sourceVersion,
                                       boolean showWarnings)
Description copied from interface: CompilerInterface
Compile the given files.

Specified by:
compile in interface CompilerInterface
Parameters:
files - Source files to compile.
classPath - Support jars or directories that should be on the classpath. If null, the default is used.
sourcePath - Location of additional sources to be compiled on-demand. If null, the default is used.
destination - Location (directory) for compiled classes. If null, the default in-place location is used.
bootClassPath - The bootclasspath (contains Java API jars or directories); should be consistent with sourceVersion If null, the default is used.
sourceVersion - The language version of the sources. Should be consistent with bootClassPath. If null, the default is used.
showWarnings - Whether compiler warnings should be shown or ignored.
Returns:
Errors that occurred. If no errors, should be zero length (not null).

version

public JavaVersion version()
Description copied from interface: CompilerInterface
The latest version of Java supported by the compiler

Specified by:
version in interface CompilerInterface

getName

public String getName()
Description copied from interface: CompilerInterface
Returns the name of this compiler, appropriate to show to the user.

Specified by:
getName in interface CompilerInterface

getDescription

public String getDescription()
Description copied from interface: CompilerInterface
Returns a one-line description of the compiler (such as the name and file location)

Specified by:
getDescription in interface CompilerInterface

toString

public String toString()
The toString() of this class is displayed in the "Compiler" drop down on the compiler tab.

Specified by:
toString in interface CompilerInterface
Overrides:
toString in class Object
Returns:
"None"

additionalBootClassPathForInteractions

public List<File> additionalBootClassPathForInteractions()
Description copied from interface: CompilerInterface
A compiler can instruct DrJava to include additional elements for the boot class path of the Interactions JVM.

Specified by:
additionalBootClassPathForInteractions in interface CompilerInterface

transformCommands

public String transformCommands(String interactionsString)
Transform the command line to be interpreted into something the Interactions JVM can use. This replaces "java MyClass a b c" with Java code to call MyClass.main(new String[]{"a","b","c"}). "import MyClass" is not handled here. transformCommands should support at least "run", "java" and "applet".

Specified by:
transformCommands in interface CompilerInterface
Parameters:
interactionsString - unprocessed command line
Returns:
command line with commands transformed

isSourceFileForThisCompiler

public boolean isSourceFileForThisCompiler(File f)
Always false

Specified by:
isSourceFileForThisCompiler in interface CompilerInterface
Parameters:
f - file to check if it is a source file
Returns:
true if the specified file is a source file for this compiler.

getSourceFileExtensions

public Set<String> getSourceFileExtensions()
Return the set of source file extensions that this compiler supports.

Specified by:
getSourceFileExtensions in interface CompilerInterface
Returns:
the set of source file extensions that this compiler supports.

getSuggestedFileExtension

public String getSuggestedFileExtension()
Return the suggested file extension that will be appended to a file without extension.

Specified by:
getSuggestedFileExtension in interface CompilerInterface
Returns:
the suggested file extension

getFileFilter

public FileFilter getFileFilter()
Return a file filter that can be used to open files this compiler supports.

Specified by:
getFileFilter in interface CompilerInterface
Returns:
file filter for appropriate source files for this compiler

getOpenAllFilesInFolderExtension

public String getOpenAllFilesInFolderExtension()
Return the extension of the files that should be opened with the "Open Folder..." command.

Specified by:
getOpenAllFilesInFolderExtension in interface CompilerInterface
Returns:
file extension for the "Open Folder..." command for this compiler.

supportsLanguageLevels

public boolean supportsLanguageLevels()
Return true if this compiler can be used in conjunction with the language level facility.

Specified by:
supportsLanguageLevels in interface CompilerInterface
Returns:
true if language levels can be used.

getKeywordsForFile

public Set<String> getKeywordsForFile(File f)
Return the set of keywords that should be highlighted in the specified file.

Specified by:
getKeywordsForFile in interface CompilerInterface
Parameters:
f - file for which to return the keywords
Returns:
the set of keywords that should be highlighted in the specified file.