org.objectweb.speedo.generation.jorm
Interface JormMIMappingBuilder

All Known Implementing Classes:
OneTableRdbJormIMappingBuilder

public interface JormMIMappingBuilder

This interface defines a builder of the mapping part of the Jorm meta information. It must be implemented for each mapper.

Author:
S.Chassande-Barrioz

Method Summary
 ClassMapping createClassMapping(Class clazz, SpeedoClass sc, Mapping mapping)
          It builds a ClassMapping, assignes it to the mapping and builds mapping structure for the class (RdbTable, directory name, ...).
 PrimitiveElementMapping createFieldMapping(PrimitiveElement pe, SpeedoElement selem, CommonClassMapping cm)
          It creates the mapping of a primitive field.
 GenClassMapping createGenClassMapping(GenClassRef gcr, SpeedoField sf, Mapping mapping)
          It builds a GenClassMapping, assignes it to the mapping and builds mapping structure for the class (RdbTable, directory name, ...).
 void createNameDefMapping(CommonClassMapping cm, NameDef nd, SpeedoClass sc, boolean isIdentifier, boolean isInGenClass)
          It creates the mapping of a name def (reference or identifier).
 void finalizeClassMapping(SpeedoClass sc, java.lang.String projectName, java.lang.String mapperName)
          It finishes the filling of a ClassMapping (Inheritance for example).
 

Method Detail

createClassMapping

public ClassMapping createClassMapping(Class clazz,
                                       SpeedoClass sc,
                                       Mapping mapping)
                                                                throws PException,
                                                                       SpeedoException
It builds a ClassMapping, assignes it to the mapping and builds mapping structure for the class (RdbTable, directory name, ...).

Parameters:
clazz - is the Jorm meta object representing the class which the ClassMapping must be built.
mapping - is the Mapping instance which will host the ClassMapping.
Returns:
the ClassMapping instance built by the method (never null).
Throws:
PException - if it is not possible to build the ClassMapping
SpeedoException

finalizeClassMapping

public void finalizeClassMapping(SpeedoClass sc,
                                 java.lang.String projectName,
                                 java.lang.String mapperName)
                          throws PException,
                                 SpeedoException
It finishes the filling of a ClassMapping (Inheritance for example).

Throws:
PException - if it is not possible to build the ClassMapping
SpeedoException

createGenClassMapping

public GenClassMapping createGenClassMapping(GenClassRef gcr,
                                             SpeedoField sf,
                                             Mapping mapping)
                                                                      throws PException,
                                                                             SpeedoException
It builds a GenClassMapping, assignes it to the mapping and builds mapping structure for the class (RdbTable, directory name, ...).

Parameters:
gcr - is the Jorm meta object representing the gen class which the GenClassMapping must be built.
mapping - is the Mapping instance which will host the GenClassMapping.
Returns:
the GenClassMapping instance built by the method (never null).
Throws:
PException - if it is not possible to build the GenClassMapping
SpeedoException

createFieldMapping

public PrimitiveElementMapping createFieldMapping(PrimitiveElement pe,
                                                  SpeedoElement selem,
                                                  CommonClassMapping cm)
                                                                           throws PException,
                                                                                  SpeedoException
It creates the mapping of a primitive field.

Parameters:
pe - is the Jorm meta object representing a primitive field
cm - is the MappingStructure which will host the mapping of the field
Returns:
a PrimitiveElementMapping corresponding to the given primitive field.
Throws:
PException - if it is not possible to build the mapping of the primitive field.
SpeedoException

createNameDefMapping

public void createNameDefMapping(CommonClassMapping cm,
                                 NameDef nd,
                                 SpeedoClass sc,
                                 boolean isIdentifier,
                                 boolean isInGenClass)
                          throws PException,
                                 SpeedoException
It creates the mapping of a name def (reference or identifier).

Parameters:
cm - is the MappingStructure which will host the mapping of the fields of the name def
nd - is the NameDef which must be mapped.
Throws:
PException - if it is not possible to build the mapping of the field.
SpeedoException