org.objectweb.speedo.generation.mivisitor
Class AbstractMetaInfoVisitor

java.lang.Object
  extended by org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
      extended by org.objectweb.speedo.generation.mivisitor.AbstractMetaInfoVisitor
All Implemented Interfaces:
GeneratorComponent, MetaInfoVisitor
Direct Known Subclasses:
CascadeDeleteSetter, DataStoreId, DiscriminatorVisitor, ExtensionVerifier, FieldConverterVisitor, IndexVisitor, InheritanceVisitor, JavaLangShorcutVisitor, JMICleanerVisitor, KeyFieldChecker, MappingExtension2Jdo, MetaDataAnalyzer, MetaInfoVisitorImpl, PrimaryKeyFieldAdder, ReverseFieldAdder, TupleExtensionCopier, VersionFieldAdder

public class AbstractMetaInfoVisitor
extends AbstractGeneratorComponent
implements MetaInfoVisitor

Author:
S.Chassande-Barrioz

Field Summary
static java.lang.String LOGGER_NAME
           
 
Fields inherited from class org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
debug, logger, personality, scp
 
Constructor Summary
AbstractMetaInfoVisitor(MetaInfoVisitor mim, Personality p)
          builds a MetaInfoVisitor which is the last of the chain
AbstractMetaInfoVisitor(Personality p)
          builds a MetaInfoVisitor which is the last of the chain
 
Method Summary
protected  java.lang.String getLoggerName()
           
 MetaInfoVisitor getNext()
           
protected static SpeedoClass getSpeedoClass(java.lang.Object o)
          Helper method able to find the SpeedoClass hosting a Speedo meta object.
 boolean init()
          Initializes the component
 void process()
          Do the job of the component.
 void setNext(MetaInfoVisitor next)
           
 void visitClass(SpeedoClass sc)
           
 void visitCompilerParameter(SpeedoCompilerParameter scp)
           
 void visitEnd()
           
 void visitEndClass(SpeedoClass sc)
           
 void visitExtension(SpeedoExtension se)
           
 void visitField(SpeedoField sf)
           
 void visitIndex(SpeedoIndex si, SpeedoPackage sp)
           
 void visitPackage(SpeedoPackage sp)
           
 void visitSequence(SpeedoSequence ss, SpeedoPackage sp)
           
 void visitXml(SpeedoXMLDescriptor xml)
           
 
Methods inherited from class org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
getLogger, getSpeedoCompilerParameter, getSummary, getTitle, 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
Constructor Detail

AbstractMetaInfoVisitor

public AbstractMetaInfoVisitor(Personality p)
builds a MetaInfoVisitor which is the last of the chain


AbstractMetaInfoVisitor

public AbstractMetaInfoVisitor(MetaInfoVisitor mim,
                               Personality p)
builds a MetaInfoVisitor which is the last of the chain

Method Detail

getLoggerName

protected java.lang.String getLoggerName()

init

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

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

process

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

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

getNext

public MetaInfoVisitor getNext()
Specified by:
getNext in interface MetaInfoVisitor

setNext

public void setNext(MetaInfoVisitor next)
Specified by:
setNext in interface MetaInfoVisitor

visitCompilerParameter

public void visitCompilerParameter(SpeedoCompilerParameter scp)
                            throws SpeedoException
Specified by:
visitCompilerParameter in interface MetaInfoVisitor
Throws:
SpeedoException

visitXml

public void visitXml(SpeedoXMLDescriptor xml)
              throws SpeedoException
Specified by:
visitXml in interface MetaInfoVisitor
Throws:
SpeedoException

visitPackage

public void visitPackage(SpeedoPackage sp)
                  throws SpeedoException
Specified by:
visitPackage in interface MetaInfoVisitor
Throws:
SpeedoException

visitClass

public void visitClass(SpeedoClass sc)
                throws SpeedoException
Specified by:
visitClass in interface MetaInfoVisitor
Throws:
SpeedoException

visitEndClass

public void visitEndClass(SpeedoClass sc)
                   throws SpeedoException
Specified by:
visitEndClass in interface MetaInfoVisitor
Throws:
SpeedoException

visitSequence

public void visitSequence(SpeedoSequence ss,
                          SpeedoPackage sp)
                   throws SpeedoException
Specified by:
visitSequence in interface MetaInfoVisitor
Throws:
SpeedoException

visitField

public void visitField(SpeedoField sf)
                throws SpeedoException
Specified by:
visitField in interface MetaInfoVisitor
Throws:
SpeedoException

visitExtension

public void visitExtension(SpeedoExtension se)
                    throws SpeedoException
Specified by:
visitExtension in interface MetaInfoVisitor
Throws:
SpeedoException

visitIndex

public void visitIndex(SpeedoIndex si,
                       SpeedoPackage sp)
                throws SpeedoException
Specified by:
visitIndex in interface MetaInfoVisitor
Throws:
SpeedoException

visitEnd

public void visitEnd()
Specified by:
visitEnd in interface MetaInfoVisitor

getSpeedoClass

protected static SpeedoClass getSpeedoClass(java.lang.Object o)
Helper method able to find the SpeedoClass hosting a Speedo meta object. if the specified object is not a child (directly or not) of a SpeedoClass then a null value is returned.

Parameters:
o - is a child (directly or not) of SpeedoClass (supported types: SpeedoClass, SpeedoField, SpeedoTuple, SpeedoExtension)