org.codehaus.groovy.control
Class CompilerConfiguration

java.lang.Object
  extended byorg.codehaus.groovy.control.CompilerConfiguration

public class CompilerConfiguration
extends java.lang.Object

Compilation control flags and coordination stuff.

Version:
$Id: CompilerConfiguration.java,v 1.10 2005/02/28 10:34:48 jstrachan Exp $
Author:
Chris Poirier

Field Summary
private  java.util.LinkedList classpath
          Classpath for use during compilation
private  boolean debug
          If true, debugging code should be activated
static CompilerConfiguration DEFAULT
           
protected static boolean DEFAULT_JSR_FLAG
          Whether to use the JSR parser or not if no property is explicitly stated
private static boolean jsrGroovy
           
private  java.io.PrintWriter output
          A PrintWriter for communicating with the user
private  ParserPluginFactory pluginFactory
           
private  java.lang.String scriptBaseClass
          Base class name for scripts (must derive from Script)
private  java.lang.String sourceEncoding
          Encoding for source files
private  java.io.File targetDirectory
          Directory into which to write classes
private  int tolerance
          The number of non-fatal errors to allow before bailing
private  boolean useNewGroovy
          should we use the New JSR Groovy parser or stay with the static one
private  boolean verbose
          If true, the compiler should produce action information
private  int warningLevel
          See WarningMessage for levels
 
Constructor Summary
CompilerConfiguration()
          Sets the Flags to defaults.
CompilerConfiguration(java.util.Properties configuration)
          Sets the Flags to the specified configuration, with defaults for those not supplied.
 
Method Summary
 java.util.List getClasspath()
          Gets the classpath.
 boolean getDebug()
          Returns true if debugging operation has been requested.
protected static boolean getDefaultJsrFlag()
           
 java.io.PrintWriter getOutput()
          Gets the currently configured output writer.
 ParserPluginFactory getPluginFactory()
           
 java.lang.String getScriptBaseClass()
          Gets the name of the base class for scripts.
 java.lang.String getSourceEncoding()
          Gets the currently configured source file encoding.
 java.io.File getTargetDirectory()
          Gets the target directory for writing classes.
 int getTolerance()
          Returns the requested error tolerance.
 boolean getVerbose()
          Returns true if verbose operation has been requested.
 int getWarningLevel()
          Gets the currently configured warning level.
static boolean isJsrGroovy()
          Returns true if we are the JSR compatible Groovy language
 boolean isUseNewGroovy()
          Returns true if the new groovy (JSR) parser is enabled
 void setClasspath(java.lang.String classpath)
          Sets the output writer.
 void setDebug(boolean debug)
          Turns debugging operation on or off.
static void setJsrGroovy(boolean value)
          Should only be called by the JSR parser
 void setOutput(java.io.PrintWriter output)
          Sets the output writer.
 void setPluginFactory(ParserPluginFactory pluginFactory)
           
 void setScriptBaseClass(java.lang.String scriptBaseClass)
          Sets the name of the base class for scripts.
 void setSourceEncoding(java.lang.String encoding)
          Sets the encoding to be used when reading source files.
 void setTargetDirectory(java.io.File directory)
          Sets the target directory.
 void setTargetDirectory(java.lang.String directory)
          Sets the target directory.
 void setTolerance(int tolerance)
          Sets the error tolerance, which is the number of non-fatal errors (per unit) that should be tolerated before compilation is aborted.
 void setUseNewGroovy(boolean useNewGroovy)
           
 void setVerbose(boolean verbose)
          Turns verbose operation on or off.
 void setWarningLevel(int level)
          Sets the warning level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final CompilerConfiguration DEFAULT

DEFAULT_JSR_FLAG

protected static final boolean DEFAULT_JSR_FLAG
Whether to use the JSR parser or not if no property is explicitly stated

See Also:
Constant Field Values

jsrGroovy

private static boolean jsrGroovy

warningLevel

private int warningLevel
See WarningMessage for levels


sourceEncoding

private java.lang.String sourceEncoding
Encoding for source files


output

private java.io.PrintWriter output
A PrintWriter for communicating with the user


targetDirectory

private java.io.File targetDirectory
Directory into which to write classes


classpath

private java.util.LinkedList classpath
Classpath for use during compilation


verbose

private boolean verbose
If true, the compiler should produce action information


debug

private boolean debug
If true, debugging code should be activated


tolerance

private int tolerance
The number of non-fatal errors to allow before bailing


scriptBaseClass

private java.lang.String scriptBaseClass
Base class name for scripts (must derive from Script)


useNewGroovy

private boolean useNewGroovy
should we use the New JSR Groovy parser or stay with the static one


pluginFactory

private ParserPluginFactory pluginFactory
Constructor Detail

CompilerConfiguration

public CompilerConfiguration()
Sets the Flags to defaults.


CompilerConfiguration

public CompilerConfiguration(java.util.Properties configuration)
                      throws ConfigurationException
Sets the Flags to the specified configuration, with defaults for those not supplied.

Method Detail

getWarningLevel

public int getWarningLevel()
Gets the currently configured warning level. See WarningMessage for level details.


setWarningLevel

public void setWarningLevel(int level)
Sets the warning level. See WarningMessage for level details.


getSourceEncoding

public java.lang.String getSourceEncoding()
Gets the currently configured source file encoding.


setSourceEncoding

public void setSourceEncoding(java.lang.String encoding)
Sets the encoding to be used when reading source files.


getOutput

public java.io.PrintWriter getOutput()
Gets the currently configured output writer.


setOutput

public void setOutput(java.io.PrintWriter output)
Sets the output writer.


getTargetDirectory

public java.io.File getTargetDirectory()
Gets the target directory for writing classes.


setTargetDirectory

public void setTargetDirectory(java.lang.String directory)
Sets the target directory.


setTargetDirectory

public void setTargetDirectory(java.io.File directory)
Sets the target directory.


getClasspath

public java.util.List getClasspath()
Gets the classpath.


setClasspath

public void setClasspath(java.lang.String classpath)
Sets the output writer.


getVerbose

public boolean getVerbose()
Returns true if verbose operation has been requested.


setVerbose

public void setVerbose(boolean verbose)
Turns verbose operation on or off.


getDebug

public boolean getDebug()
Returns true if debugging operation has been requested.


setDebug

public void setDebug(boolean debug)
Turns debugging operation on or off.


getTolerance

public int getTolerance()
Returns the requested error tolerance.


setTolerance

public void setTolerance(int tolerance)
Sets the error tolerance, which is the number of non-fatal errors (per unit) that should be tolerated before compilation is aborted.


getScriptBaseClass

public java.lang.String getScriptBaseClass()
Gets the name of the base class for scripts. It must be a subclass of Script.


setScriptBaseClass

public void setScriptBaseClass(java.lang.String scriptBaseClass)
Sets the name of the base class for scripts. It must be a subclass of Script.


isUseNewGroovy

public boolean isUseNewGroovy()
Returns true if the new groovy (JSR) parser is enabled


setUseNewGroovy

public void setUseNewGroovy(boolean useNewGroovy)

getPluginFactory

public ParserPluginFactory getPluginFactory()

setPluginFactory

public void setPluginFactory(ParserPluginFactory pluginFactory)

isJsrGroovy

public static boolean isJsrGroovy()
Returns true if we are the JSR compatible Groovy language


setJsrGroovy

public static void setJsrGroovy(boolean value)
Should only be called by the JSR parser


getDefaultJsrFlag

protected static boolean getDefaultJsrFlag()


Copyright © 2003-2005 The Codehaus. All Rights Reserved.