org.objectweb.jorm.comp.compiler.lib
Class BasicCompiler

java.lang.Object
  |
  +--org.objectweb.jorm.comp.compiler.lib.BasicCompiler

public class BasicCompiler
extends java.lang.Object

Author:
Sebastien Chassande-Barrioz

Field Summary
protected  BasicClassLoader classLoader
           
protected  CompilerParameter compilerParameter
          The compiler parameters
static java.lang.String FILE_MAPPER_NAME
           
protected  JormGenerator generator
          generator is a simple JormGenerator object, which is able to generate java file.
protected  org.objectweb.util.monolog.api.Logger logger
          The logger used by the compiler to log messages
protected  Manager manager
          The manager is in charge of the meta information management.
static java.lang.String MEMORY_MAPPER_NAME
           
protected  Parser parser
          parser object is able to parse XML files and build an internal representation of its content.
static java.lang.String RDB_MAPPER_NAME
           
 
Constructor Summary
BasicCompiler()
          It builds a BasicCompiler with a new BasicCompilerParameter.
BasicCompiler(CompilerParameter compilerParameter, BasicClassLoader bcl)
          It builds a BasicCompiler with the specified BasicCompilerParameter instance.
 
Method Summary
 void compileFiles()
          Compiles java files generated by the generator system.
 java.util.Collection generateFiles(java.util.Collection c)
          Generates java files for all meta object specified in the Collection parameter.
 CompilerParameter getCompilerParameter()
          It retrieves the CompilerParameter associated to the compiler
 java.util.Collection parseFiles(java.util.Collection fns)
          Parses the input files and build the meta information.
 void process()
          Creates class instances for the XML parser, the Meta Information Manager and manages the JormGenerator system.
 void verifyContext()
          Verifies if the needed parameters are available for a normal processing.
 void verifyMetaInfo(java.util.Collection mos)
          Verifies if the metainformation is in a properly state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RDB_MAPPER_NAME

public static final java.lang.String RDB_MAPPER_NAME

FILE_MAPPER_NAME

public static final java.lang.String FILE_MAPPER_NAME

MEMORY_MAPPER_NAME

public static final java.lang.String MEMORY_MAPPER_NAME

parser

protected Parser parser
parser object is able to parse XML files and build an internal representation of its content.

manager

protected Manager manager
The manager is in charge of the meta information management.

generator

protected JormGenerator generator
generator is a simple JormGenerator object, which is able to generate java file.

compilerParameter

protected CompilerParameter compilerParameter
The compiler parameters

classLoader

protected BasicClassLoader classLoader

logger

protected org.objectweb.util.monolog.api.Logger logger
The logger used by the compiler to log messages
Constructor Detail

BasicCompiler

public BasicCompiler()
It builds a BasicCompiler with a new BasicCompilerParameter.

BasicCompiler

public BasicCompiler(CompilerParameter compilerParameter,
                     BasicClassLoader bcl)
It builds a BasicCompiler with the specified BasicCompilerParameter instance.
Method Detail

getCompilerParameter

public CompilerParameter getCompilerParameter()
It retrieves the CompilerParameter associated to the compiler
Returns:
the compiler parameter

process

public void process()
             throws PException
Creates class instances for the XML parser, the Meta Information Manager and manages the JormGenerator system.

verifyContext

public void verifyContext()
                   throws PException
Verifies if the needed parameters are available for a normal processing.

parseFiles

public java.util.Collection parseFiles(java.util.Collection fns)
                                throws PException
Parses the input files and build the meta information.

verifyMetaInfo

public void verifyMetaInfo(java.util.Collection mos)
                    throws PException
Verifies if the metainformation is in a properly state.

generateFiles

public java.util.Collection generateFiles(java.util.Collection c)
                                   throws PException
Generates java files for all meta object specified in the Collection parameter. If the parameter is null, all classes described in the meta information manager are generated.
Parameters:
c - is the collection of meta objects
Returns:
a Collection of String. The elements are the file names of the generated files

compileFiles

public void compileFiles()
                  throws PException
Compiles java files generated by the generator system.