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
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
CompilerError s |
protected java.util.List |
parseModernStream(java.io.BufferedReader input)
Parse the compiler error stream to produce a list of
CompilerError s |
protected java.util.List |
parseStream(java.io.BufferedReader input)
Parse the compiler error stream to produce a list of
CompilerError s |
java.lang.String |
toString()
|
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 |
CLASSIC_CLASS
public static final java.lang.String CLASSIC_CLASS
MODERN_CLASS
public static final java.lang.String MODERN_CLASS
Javac
public Javac()
Javac
protected Javac(boolean modern)
compile
public boolean compile()
throws java.io.IOException
- Compile a source file yielding a loadable class file.
- Parameters:
filename
- The object program base file namebaseDirectory
- The directory containing the object program fileencoding
- 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
CompilerError
s
- 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
CompilerError
s
- 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
CompilerError
s
- 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.