org.objectweb.speedo.generation.compiler
Class Compiler

java.lang.Object
  extended by org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
      extended by org.objectweb.speedo.generation.compiler.Compiler
All Implemented Interfaces:
GeneratorComponent

public class Compiler
extends AbstractGeneratorComponent

Compiles all generated .java files.

This class is based on Ant that is a Java-based build tool (see http://jakarta.apache.org/ant for more information).

Author:
S.Chassande-Barrioz

Field Summary
protected  org.apache.tools.ant.taskdefs.Javac compiler
          Ant Task intended to java compilation
static java.lang.String LOGGER_NAME
           
static char SEPARATOR
          System separator character (e.g '/' under Unix systems)
 
Fields inherited from class org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
debug, logger, personality, scp
 
Constructor Summary
Compiler(Personality p)
           
 
Method Summary
 java.lang.String getSummary()
           
 java.lang.String getTitle()
           
 boolean init()
          Initializes this Compiler.
 void process()
          Tries to process the compilation internally.
 
Methods inherited from class org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
getLogger, getSpeedoCompilerParameter, setLogger, setSpeedoCompilerParameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER_NAME

public static final java.lang.String LOGGER_NAME
See Also:
Constant Field Values

SEPARATOR

public static final char SEPARATOR
System separator character (e.g '/' under Unix systems)


compiler

protected org.apache.tools.ant.taskdefs.Javac compiler
Ant Task intended to java compilation

Constructor Detail

Compiler

public Compiler(Personality p)
Method Detail

getTitle

public java.lang.String getTitle()
Specified by:
getTitle in interface GeneratorComponent
Overrides:
getTitle in class AbstractGeneratorComponent
Returns:
a short string (less than 30 characters) representing the title of the component. This string must indicate job of the component.

getSummary

public java.lang.String getSummary()
Specified by:
getSummary in interface GeneratorComponent
Overrides:
getSummary in class AbstractGeneratorComponent
Returns:
a short string (less than 50 characters) summarizing the job of component (ex: how many files generated or compiled, ...)

init

public boolean init()
Initializes this Compiler.

Specified by:
init in interface GeneratorComponent
Specified by:
init in class AbstractGeneratorComponent
Returns:
boolean value indicating if the process method can be called.

process

public void process()
             throws SpeedoException
Tries to process the compilation internally.

Specified by:
process in interface GeneratorComponent
Specified by:
process in class AbstractGeneratorComponent
Throws:
SpeedoException - if compilation fails