TOP

mapper

Description

Define correspondence between the source and target models. Map instances of source METAmodel packages, classes, enums and structs (i.e. model elements) to corresponding instances of the target METAmodel elements. Convention:
 Usage:
   source package + target package  
     -> maps all classes in the source package to target classes with the same name and target package,
        this way effectively just renaming the package and copying its contents
     
   source package + source type name + target package + target type name 
     -> maps a single source class (by qualified name) to a single target class (by its qualified name)
     
   source package + source type name + target package + target type name + nested Ant tasks 
     -> maps a single source class (by qualified name) to a single target class (by its qualified name)
        and calls the Ant tasks script for each instance of the source type with the properties:
          source = source type instance (model object/element)
          target = target type instance (model object/element)
        
   source package + source type name + field name + target field name 
     -> maps a single field name in source class (by qualified name) to a single field name
        in the corresponding target class, where this correspondence is defined in another map either
        as source class to target class mapping or as source package to target package mapping.  
     
   source type name + target type name 
     -> maps a single source class (by simple name) to a single target class (by its simple name)
     
   source type name + target type name + nested Ant tasks
     -> maps a single source class (by simple name) to a single target class (by its simple name)
        and calls the Ant tasks script for each instance of the source class, with the properties:
          source = source type instance (model object/element)
          target = target type instance (model object/element)
     
   source type name + field name + target field name 
     -> maps a single single field in a source class (by simple name) to a single field name
        in the corresponding target class, where this correspondence is defined in another map either
        as source class to target class mapping or as source package to target package mapping.  
     
   source package + source enum type name + source enum value + target enum value 
     -> maps a single value of an enumeration (by qualified name) in the source model to a target enum value
     
   source enum type name + source enum value + target enum value 
     -> maps a single value of an enumeration (by simple name) in the source model to a target enum value
     
   source enum value + target enum value 
     -> maps a single value of an enumeration in the source model to a target enum value
     
   source field name + target field name 
     -> maps a single field name to a target field value
 
Ant definition (see antlib.xml):
   <copy.metamodels>
     <mapper>
        <map sourcePackage=... />
     </mapper>
   </copy.metamodels>
 
The fixed target field name NO-MAP allows skipping a field's mapping.

Implementation class

net.mdatools.modelant.core.util.conversion.RenamingMapping

Nested elements

Element Description
map Define correspondence at mdetamodel level. This tasks container maps a source meta package/class/field name to target meta package/class/field name.

Parameters

Attribute Description Type
sourceField Declares the simple source field name to map from String
sourcePackage Declares the qualified source package name to map from String
sourceType Declares the simple source class name to map from String
sourceValue Declares the source enum value (by name) to map from String
targetField Declares the simple target field name to map to. If NO-MAP provided as target field name, then the value of the source field will not be copied to the target model. String
targetPackage Declares the qualified target package name to map to String
targetType Declares the simple target class name to map to String
targetValue Declares the target enum value (by name) to map from String

Nested elements

Element Description
Any task These are tasks to handle the specific model transformations

Use <typedef resource="net/mdatools/modelant/core/antlib.xml"/>
Documentation generated by ant.doc Ant macro from ModelAnt by MDA Tools