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

java.lang.Object
  |
  +--org.apache.avalon.framework.logger.AbstractLoggable
        |
        +--org.apache.cocoon.components.language.programming.java.AbstractJavaCompiler
              |
              +--org.apache.cocoon.components.language.programming.java.Javac
All Implemented Interfaces:
org.apache.avalon.framework.component.Component, LanguageCompiler, org.apache.avalon.framework.logger.Loggable, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable
Direct Known Subclasses:
Pizza

public class Javac
extends AbstractJavaCompiler

This class wraps the Sun's Javac Compiler.

Since:
2.0
Version:
CVS $Id: Javac.java,v 1.6 2002/02/22 07:00:09 cziegeler Exp $
Author:
Stefano Mazzocchi

Field Summary
static java.lang.String CLASSIC_CLASS
           
static java.lang.String MODERN_CLASS
           
 
Fields inherited from class org.apache.cocoon.components.language.programming.java.AbstractJavaCompiler
classpath, destDir, encoding, errors, file, srcDir
 
Constructor Summary
  Javac()
           
protected Javac(boolean modern)
           
 
Method Summary
 boolean compile()
          Compile a source file yielding a loadable class file.
protected  java.util.List parseClassicStream(java.io.BufferedReader input)
          Parse the compiler error stream to produce a list of CompilerErrors
protected  java.util.List parseModernStream(java.io.BufferedReader input)
          Parse the compiler error stream to produce a list of CompilerErrors
protected  java.util.List parseStream(java.io.BufferedReader input)
          Parse the compiler error stream to produce a list of CompilerErrors
 java.lang.String toString()
           
 
Methods inherited from class org.apache.cocoon.components.language.programming.java.AbstractJavaCompiler
fillArguments, getErrors, recycle, setClasspath, setDestination, setEncoding, setFile, setSource, toStringArray
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASSIC_CLASS

public static final java.lang.String CLASSIC_CLASS

MODERN_CLASS

public static final java.lang.String MODERN_CLASS
Constructor Detail

Javac

public Javac()

Javac

protected Javac(boolean modern)
Method Detail

compile

public boolean compile()
                throws java.io.IOException
Compile a source file yielding a loadable class file.
Parameters:
filename - The object program base file name
baseDirectory - The directory containing the object program file
encoding - The encoding expected in the source file or null if it is the platform's default encoding
Throws:
LanguageException - If an error occurs during compilation

parseStream

protected java.util.List parseStream(java.io.BufferedReader input)
                              throws java.io.IOException
Parse the compiler error stream to produce a list of CompilerErrors
Overrides:
parseStream in class AbstractJavaCompiler
Parameters:
errors - The error stream
Returns:
The list of compiler error messages
Throws:
java.io.IOException - If an error occurs during message collection

parseModernStream

protected java.util.List parseModernStream(java.io.BufferedReader input)
                                    throws java.io.IOException
Parse the compiler error stream to produce a list of CompilerErrors
Parameters:
errors - The error stream
Returns:
The list of compiler error messages
Throws:
java.io.IOException - If an error occurs during message collection

parseClassicStream

protected java.util.List parseClassicStream(java.io.BufferedReader input)
                                     throws java.io.IOException
Parse the compiler error stream to produce a list of CompilerErrors
Parameters:
errors - The error stream
Returns:
The list of compiler error messages
Throws:
java.io.IOException - If an error occurs during message collection

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.