org.apache.cocoon.components.language.programming.java
Class EclipseJavaCompiler

java.lang.Object
  extended by org.apache.cocoon.components.language.programming.java.EclipseJavaCompiler
All Implemented Interfaces:
Poolable, Recyclable, Component, LanguageCompiler

public class EclipseJavaCompiler
extends Object
implements LanguageCompiler, Recyclable

Eclipse Java Compiler

Version:
$Id: EclipseJavaCompiler.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Constructor Summary
EclipseJavaCompiler()
           
 
Method Summary
 boolean compile()
          Compile a source file yielding a loadable program file.
 List getErrors()
          Return the list of errors generated by this compilation
 void recycle()
           
 void setClasspath(String cp)
          Eclipse Java compiler ignores class path setting and uses current Java class loader
 void setCompilerComplianceLevel(int compilerComplianceLevel)
          Set the version of the java source code to be compiled
 void setDestination(String destDir)
          Set the name of the directory to contain the resulting object program file
 void setEncoding(String encoding)
          Set the encoding of the input source file or null to use the platform's default encoding
 void setFile(String file)
          Set the name of the file containing the source program
 void setSource(String srcDir)
          Set the name of the directory containing the source program file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EclipseJavaCompiler

public EclipseJavaCompiler()
Method Detail

recycle

public void recycle()
Specified by:
recycle in interface Recyclable

setFile

public void setFile(String file)
Description copied from interface: LanguageCompiler
Set the name of the file containing the source program

Specified by:
setFile in interface LanguageCompiler
Parameters:
file - The name of the file containing the source program

setSource

public void setSource(String srcDir)
Description copied from interface: LanguageCompiler
Set the name of the directory containing the source program file

Specified by:
setSource in interface LanguageCompiler
Parameters:
srcDir - The name of the directory containing the source program file

setDestination

public void setDestination(String destDir)
Description copied from interface: LanguageCompiler
Set the name of the directory to contain the resulting object program file

Specified by:
setDestination in interface LanguageCompiler
Parameters:
destDir - The name of the directory to contain the resulting object program file

setEncoding

public void setEncoding(String encoding)
Description copied from interface: LanguageCompiler
Set the encoding of the input source file or null to use the platform's default encoding

Specified by:
setEncoding in interface LanguageCompiler
Parameters:
encoding - The encoding of the input source file or null to use the platform's default encoding

setCompilerComplianceLevel

public void setCompilerComplianceLevel(int compilerComplianceLevel)
Set the version of the java source code to be compiled

Specified by:
setCompilerComplianceLevel in interface LanguageCompiler
Parameters:
compilerComplianceLevel - The version of the JVM for wich the code was written. i.e: 130 = Java 1.3, 140 = Java 1.4 and 150 = Java 1.5
Since:
2.1.7

setClasspath

public void setClasspath(String cp)
Eclipse Java compiler ignores class path setting and uses current Java class loader

Specified by:
setClasspath in interface LanguageCompiler
Parameters:
cp - classpath to be ignored

compile

public boolean compile()
                throws IOException
Description copied from interface: LanguageCompiler
Compile a source file yielding a loadable program file.

Specified by:
compile in interface LanguageCompiler
Throws:
IOException - If an error occurs during compilation

getErrors

public List getErrors()
               throws IOException
Description copied from interface: LanguageCompiler
Return the list of errors generated by this compilation

Specified by:
getErrors in interface LanguageCompiler
Returns:
The list of errors generated by this compilation
Throws:
IOException - If an error occurs during message collection


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.