org.objectweb.speedo.generation.lib
Class AbstractGeneratorComponent

java.lang.Object
  extended by org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
All Implemented Interfaces:
GeneratorComponent
Direct Known Subclasses:
AbstractEnhancer, AbstractEnhancerComponent, AbstractGenerator, AbstractMetaInfoVisitor, AbstractParser, AbstractVelocityGenerator, Compiler, EJBAnnotationParser, EJBDescParser, JormGenerator, JormMIGenerator, MetaInfoVisitors, MISerializer, ORMappingGenerator

public abstract class AbstractGeneratorComponent
extends java.lang.Object
implements GeneratorComponent

Author:
S.Chassande-Barrioz

Field Summary
protected  boolean debug
           
protected  org.objectweb.util.monolog.api.Logger logger
           
protected  Personality personality
           
protected  SpeedoCompilerParameter scp
           
 
Constructor Summary
AbstractGeneratorComponent(Personality p)
           
 
Method Summary
 org.objectweb.util.monolog.api.Logger getLogger()
           
 SpeedoCompilerParameter getSpeedoCompilerParameter()
          Retrieves the parameters holder
 java.lang.String getSummary()
           
 java.lang.String getTitle()
           
abstract  boolean init()
          Initializes the component
abstract  void process()
          Do the job of the component.
 void setLogger(org.objectweb.util.monolog.api.Logger logger)
           
 void setSpeedoCompilerParameter(SpeedoCompilerParameter scp)
          Assignes the parameters holder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

scp

protected SpeedoCompilerParameter scp

logger

protected org.objectweb.util.monolog.api.Logger logger

debug

protected boolean debug

personality

protected Personality personality
Constructor Detail

AbstractGeneratorComponent

public AbstractGeneratorComponent(Personality p)
Method Detail

setSpeedoCompilerParameter

public void setSpeedoCompilerParameter(SpeedoCompilerParameter scp)
Description copied from interface: GeneratorComponent
Assignes the parameters holder

Specified by:
setSpeedoCompilerParameter in interface GeneratorComponent

getSpeedoCompilerParameter

public SpeedoCompilerParameter getSpeedoCompilerParameter()
Description copied from interface: GeneratorComponent
Retrieves the parameters holder

Specified by:
getSpeedoCompilerParameter in interface GeneratorComponent

getLogger

public org.objectweb.util.monolog.api.Logger getLogger()

setLogger

public void setLogger(org.objectweb.util.monolog.api.Logger logger)

init

public abstract boolean init()
                      throws SpeedoException
Description copied from interface: GeneratorComponent
Initializes the component

Specified by:
init in interface GeneratorComponent
Returns:
boolean value indicating if the process method can be called.
Throws:
SpeedoException - if the component initialization fails

process

public abstract void process()
                      throws SpeedoException
Description copied from interface: GeneratorComponent
Do the job of the component.

Specified by:
process in interface GeneratorComponent
Throws:
SpeedoException - if the component initialization fails

getTitle

public java.lang.String getTitle()
Specified by:
getTitle in interface GeneratorComponent
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
Returns:
a short string (less than 50 characters) summarizing the job of component (ex: how many files generated or compiled, ...)