org.jetbrains.jet.cli.common
Class CLICompiler<A extends CommonCompilerArguments>

java.lang.Object
  extended by org.jetbrains.jet.cli.common.CLICompiler<A>
Direct Known Subclasses:
K2JSCompiler, K2JVMCompiler

public abstract class CLICompiler<A extends CommonCompilerArguments>
extends java.lang.Object


Constructor Summary
CLICompiler()
           
 
Method Summary
protected  void checkArguments(A argument)
           
protected  void configureEnvironment(CompilerConfiguration configuration, A arguments)
          Strategy method to configure the environment, allowing compiler based tools to customise their own plugins
protected abstract  A createArguments()
           
protected abstract  ExitCode doExecute(A arguments, MessageCollector messageCollector, com.intellij.openapi.Disposable rootDisposable)
           
static void doMain(CLICompiler compiler, java.lang.String[] args)
          Useful main for derived command line tools
static ExitCode doMainNoExit(CLICompiler compiler, java.lang.String[] args)
           
 ExitCode exec(MessageCollector messageCollector, A arguments)
           
 ExitCode exec(java.io.PrintStream errStream, A arguments)
          Executes the compiler on the parsed arguments
 ExitCode exec(java.io.PrintStream errStream, java.lang.String... args)
           
 java.util.List<CompilerPlugin> getCompilerPlugins()
           
protected  MessageRenderer getMessageRenderer(A arguments)
           
protected  boolean parseArguments(java.io.PrintStream errStream, A arguments, java.lang.String[] args)
          Returns true if the arguments can be parsed correctly
protected  void printVersionIfNeeded(java.io.PrintStream errStream, A arguments, MessageRenderer messageRenderer)
           
 void setCompilerPlugins(java.util.List<CompilerPlugin> compilerPlugins)
           
protected  void usage(java.io.PrintStream target)
          Allow derived classes to add additional command line arguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CLICompiler

public CLICompiler()
Method Detail

getCompilerPlugins

@NotNull
public java.util.List<CompilerPlugin> getCompilerPlugins()

setCompilerPlugins

public void setCompilerPlugins(@NotNull
                               java.util.List<CompilerPlugin> compilerPlugins)

exec

@NotNull
public ExitCode exec(@NotNull
                             java.io.PrintStream errStream,
                             @NotNull
                             java.lang.String... args)

parseArguments

protected boolean parseArguments(@NotNull
                                 java.io.PrintStream errStream,
                                 @NotNull
                                 A arguments,
                                 @NotNull
                                 java.lang.String[] args)
Returns true if the arguments can be parsed correctly


checkArguments

protected void checkArguments(@NotNull
                              A argument)

usage

protected void usage(@NotNull
                     java.io.PrintStream target)
Allow derived classes to add additional command line arguments


configureEnvironment

protected void configureEnvironment(@NotNull
                                    CompilerConfiguration configuration,
                                    @NotNull
                                    A arguments)
Strategy method to configure the environment, allowing compiler based tools to customise their own plugins


createArguments

@NotNull
protected abstract A createArguments()

exec

@NotNull
public ExitCode exec(@NotNull
                             java.io.PrintStream errStream,
                             @NotNull
                             A arguments)
Executes the compiler on the parsed arguments


exec

@NotNull
public ExitCode exec(@NotNull
                             MessageCollector messageCollector,
                             @NotNull
                             A arguments)

doExecute

@NotNull
protected abstract ExitCode doExecute(@NotNull
                                              A arguments,
                                              @NotNull
                                              MessageCollector messageCollector,
                                              @NotNull
                                              com.intellij.openapi.Disposable rootDisposable)

getMessageRenderer

@NotNull
protected MessageRenderer getMessageRenderer(@NotNull
                                                     A arguments)

printVersionIfNeeded

protected void printVersionIfNeeded(@NotNull
                                    java.io.PrintStream errStream,
                                    @NotNull
                                    A arguments,
                                    @NotNull
                                    MessageRenderer messageRenderer)

doMain

public static void doMain(@NotNull
                          CLICompiler compiler,
                          @NotNull
                          java.lang.String[] args)
Useful main for derived command line tools


doMainNoExit

@NotNull
public static ExitCode doMainNoExit(@NotNull
                                            CLICompiler compiler,
                                            @NotNull
                                            java.lang.String[] args)