Cantaloop CGimlet - API Documentation, Version: 0.2.0, Date: 2002-05-13 21:30 CEST

org.cantaloop.cgimlet.lang.java
Class JCompiler

java.lang.Object
  |
  +--org.cantaloop.cgimlet.lang.java.JCompiler
All Implemented Interfaces:
CodeCompiler

public class JCompiler
extends java.lang.Object
implements CodeCompiler


Constructor Summary
JCompiler()
           
 
Method Summary
 void addToClasspath(java.io.File f)
          Addes the given file to the classpath. used for this compilation process.
 void clearClasspath()
          Removes all entries of the classpath.
 void compile(java.io.File inputFile)
          Compiles the given file.
 void compile(java.util.List inputFiles)
          Compiles the given list of files.
 java.util.List getClasspath()
          Returns a (read-only) list with all entries of the classpath.
 org.cantaloop.tools.logging.Logger getLogger()
          Returns the logger.
 java.io.File getTargetDir()
          Returns the target directory of this compiler.
 void setForceToolsJar(boolean b)
          Specify if the compiler should try to invoke javac in an external process if tools.jar could not be found.
 void setLogger(org.cantaloop.tools.logging.Logger l)
          Sets the logger that should be used to log the messages of the compiler
 void setTargetDir(java.io.File targetDir)
          Sets the directory under which the compiled files should be placed.
 void setUseToolsJar(boolean b)
          Specifies if the compiler should try to use the javac compiler directly (that is, without starting another virtual machine).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCompiler

public JCompiler()
Method Detail

setLogger

public void setLogger(org.cantaloop.tools.logging.Logger l)
Description copied from interface: CodeCompiler
Sets the logger that should be used to log the messages of the compiler
Specified by:
setLogger in interface CodeCompiler

getLogger

public org.cantaloop.tools.logging.Logger getLogger()
Description copied from interface: CodeCompiler
Returns the logger.
Specified by:
getLogger in interface CodeCompiler

setTargetDir

public void setTargetDir(java.io.File targetDir)
Description copied from interface: CodeCompiler
Sets the directory under which the compiled files should be placed.
Specified by:
setTargetDir in interface CodeCompiler

getTargetDir

public java.io.File getTargetDir()
Description copied from interface: CodeCompiler
Returns the target directory of this compiler.
Specified by:
getTargetDir in interface CodeCompiler

addToClasspath

public void addToClasspath(java.io.File f)
Addes the given file to the classpath. used for this compilation process.

clearClasspath

public void clearClasspath()
Removes all entries of the classpath.

getClasspath

public java.util.List getClasspath()
Returns a (read-only) list with all entries of the classpath.

setUseToolsJar

public void setUseToolsJar(boolean b)
Specifies if the compiler should try to use the javac compiler directly (that is, without starting another virtual machine). If the library tools.jar cannot be found, javac is invoked in a separate process. You should enable this option as it results in a faster compilation. The default value of this option is true.

Note: This method is mainly for testing purpose.

Parameters:
b - true if the compiler should try to use tools.jar first.
See Also:
setForceToolsJar(boolean)

setForceToolsJar

public void setForceToolsJar(boolean b)
Specify if the compiler should try to invoke javac in an external process if tools.jar could not be found. This option is set to false by default.

Note: This method is mainly for testing purpose.

Parameters:
b - true if the compiler should not try to invoke javac in a separate process.
See Also:
setUseToolsJar(boolean)

compile

public void compile(java.io.File inputFile)
Description copied from interface: CodeCompiler
Compiles the given file.
Specified by:
compile in interface CodeCompiler

compile

public void compile(java.util.List inputFiles)
Description copied from interface: CodeCompiler
Compiles the given list of files.
Specified by:
compile in interface CodeCompiler
Following copied from interface: org.cantaloop.cgimlet.lang.CodeCompiler
Parameters:
l - a List of Files.

Copyright 2001, 2002 Stefan Heimann, David Leuschner. All rights reserved.