net.sf.jsptest.compiler.java
Class SunJavaC

java.lang.Object
  extended by net.sf.jsptest.compiler.java.SunJavaC
All Implemented Interfaces:
JavaCompiler

public class SunJavaC
extends java.lang.Object
implements JavaCompiler

This implementation uses the java compiler from sun which ships with since the jdk since java 1.3. The code is inspired by the javac ant task implementation.

Author:
mathias.broekelmann

Constructor Summary
SunJavaC()
           
 
Method Summary
 boolean compile(java.lang.String pathToJavaSource, java.lang.String outputDirectory, java.lang.String[] classpath)
          Compiles the given .java source file into the given .class file using an explicitly set class path.
 boolean isAvailable()
          Indicates whether this Java compiler implementation is available on the current system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SunJavaC

public SunJavaC()
Method Detail

compile

public boolean compile(java.lang.String pathToJavaSource,
                       java.lang.String outputDirectory,
                       java.lang.String[] classpath)
                throws java.lang.Exception
Description copied from interface: JavaCompiler
Compiles the given .java source file into the given .class file using an explicitly set class path.

Specified by:
compile in interface JavaCompiler
Parameters:
pathToJavaSource - Path to the source file to compile.
outputDirectory - Path to the output directory under which to generate the .class file
classpath - The class path to use for compilation.
Throws:
java.lang.Exception

isAvailable

public boolean isAvailable()
Description copied from interface: JavaCompiler
Indicates whether this Java compiler implementation is available on the current system.

Specified by:
isAvailable in interface JavaCompiler


Copyright © 2006-2008 JspTest developers. All Rights Reserved.