org.objectweb.jorm.generator.api
Interface Generator


public interface Generator

Generation is a simple interface which allows to generate object file depending on their nature. The compiler uses Meta Object to build the input source tree.

Author:
P. Dechamboux

Method Summary
 void addMappingGenerator(java.lang.String mappername, MOPFactory mappinggenerator)
          Adds a mapping generator which generates a specific mapping part.
 void generate(Class mo, org.objectweb.jorm.util.io.api.TargetHolder th, JormCompilerParameter cp, JormCompilerConfigurator jcc)
          Generates code for the given Class.
 void generate(CompositeName mo, org.objectweb.jorm.util.io.api.TargetHolder th, JormCompilerParameter cp)
          Generates code for the given CompositeName.
 void init()
          Initializes the generator.
 void setCompilerConfigurator(JormCompilerConfigurator jcc)
          Assigns the compiler configurator to this generator.
 void setCompilerParameter(JormCompilerParameter jcp)
          Assigns the compiler parameter to this generator.
 void setMetaInfoManager(Manager mim)
          Assigns the meta information manager to this generator.
 void setPathExplorer(org.objectweb.jorm.util.io.api.PathExplorer pathexpl)
          Assigns a PathExplorer object for locating files that have to be parsed.
 

Method Detail

init

public void init()
          throws PException
Initializes the generator. Should be called after setCompilerParameter and setCompilerConfigurator.

Throws:
PException

setCompilerParameter

public void setCompilerParameter(JormCompilerParameter jcp)
Assigns the compiler parameter to this generator.

Parameters:
jcp - the compiler parameter.

setCompilerConfigurator

public void setCompilerConfigurator(JormCompilerConfigurator jcc)
Assigns the compiler configurator to this generator.

Parameters:
jcc - the compiler configurator.

setMetaInfoManager

public void setMetaInfoManager(Manager mim)
Assigns the meta information manager to this generator.

Parameters:
mim - the meta information manager to use.

setPathExplorer

public void setPathExplorer(org.objectweb.jorm.util.io.api.PathExplorer pathexpl)
Assigns a PathExplorer object for locating files that have to be parsed.

Parameters:
pathexpl - the PathExplorer to be used for file location

addMappingGenerator

public void addMappingGenerator(java.lang.String mappername,
                                MOPFactory mappinggenerator)
Adds a mapping generator which generates a specific mapping part.

Parameters:
mappername - The name of the mapper.
mappinggenerator - The Mapping Verifier object.

generate

public void generate(Class mo,
                     org.objectweb.jorm.util.io.api.TargetHolder th,
                     JormCompilerParameter cp,
                     JormCompilerConfigurator jcc)
              throws PException
Generates code for the given Class.

Parameters:
mo - The class meta-object.
th - The target holder which allows to create files.
cp - This parameter permits to reach the compilation parameters.
jcc - The actual configuration of the compiler.
Throws:
PException

generate

public void generate(CompositeName mo,
                     org.objectweb.jorm.util.io.api.TargetHolder th,
                     JormCompilerParameter cp)
              throws PException
Generates code for the given CompositeName.

Parameters:
mo - The composite name meta-object.
th - The target holder which allows to create files.
cp - This parameter permits to reach the compilation parameters.
Throws:
PException