org.objectweb.speedo.generation.parser
Class AbstractParser

java.lang.Object
  extended by org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
      extended by org.objectweb.speedo.generation.parser.AbstractParser
All Implemented Interfaces:
GeneratorComponent
Direct Known Subclasses:
EJBPersistenceParser, JDO2Parser, JDOParser

public abstract class AbstractParser
extends AbstractGeneratorComponent


Field Summary
static java.lang.String LOGGER_NAME
           
 
Fields inherited from class org.objectweb.speedo.generation.lib.AbstractGeneratorComponent
debug, logger, personality, scp
 
Constructor Summary
AbstractParser(Personality p)
           
 
Method Summary
protected abstract  java.lang.String getLoggerName()
           
 java.lang.String getSummary()
           
 java.lang.String getTitle()
           
 boolean init()
          The parser instance is reused at each process method call
 void process()
          Do the job of the component.
protected abstract  java.lang.Object treatDocument(org.w3c.dom.Node node, java.lang.Object o)
          Create the XML file descriptor.
 
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 java.lang.String LOGGER_NAME
Constructor Detail

AbstractParser

public AbstractParser(Personality p)
Method Detail

getLoggerName

protected abstract java.lang.String getLoggerName()

treatDocument

protected abstract java.lang.Object treatDocument(org.w3c.dom.Node node,
                                                  java.lang.Object o)
                                           throws SpeedoException
Create the XML file descriptor. It throws an exception if the XML file doesn't follow the relevant dtd.

Parameters:
node - root node of the descriptor which will be return.
o - default descriptor to return.
Returns:
descriptor.
Throws:
SpeedoException

init

public boolean init()
             throws SpeedoException
The parser instance is reused at each process method call

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

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, ...)