mapper |
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:
- if no mapping defined, then assume that the source and the target model elements have the same qualified names.
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. |