Tag: rule
Defines a new namespace rule. A rule defines a translation between system namespace and the defined namespace, and vice versa.
See namespace doc for details.
Element | Description | Cardinality |
---|---|---|
fromsystem | defines the translation to apply from system namespace to the defined namespace | 1 |
tosystem | defines the translation to apply from the defined namespace to system namespace | 1 |
Tag: fromsystem / tosystem
Defines a one way translation rule, i.e. a translation from system namespace to the defined namespace or vice versa.
Element | Description | Cardinality |
---|---|---|
src | defines a source name which can be accepted | 1..n |
dest | defines the translation to apply when a name is accepted by an src pattern | 1 |
Tag: src
Defines the acceptation part of a translation rule. If a name matches this src, it will be translated using the dest part.
Attribute | Description | Required |
---|---|---|
org | the organisation to match as a regexp | No, defaults to .* |
module | the module name to match as a regexp | No, defaults to .* |
rev | the revision to match as a regexp | No, defaults to .* |
Tag: dest
Defines the translation part of a translation rule. If a name has matched a corresponding src, it will be translated using this dest part.
The new names can contain references to groups of the matched name, using a slightly modified regexp syntax. Indeed, referenced groups can be part of either the organisation, module or revision part of the original name. So, to reference the groups, you just have to add a letter identifying the part in which the group should be selected: o for organisation, m for module, and r for revision.
For instance, $o0 matches the whole matched organisation, and $m0 the whole matched module name. $o1 matches the first group of the matched organisation.
For details about regexp and groups, see the Pattern class documentation in the jdk.
Attribute | Description | Required |
---|---|---|
org | the new organisation name | No, defaults to $o0 |
module | the new module name | No, defaults to $m0 |
rev | the new revision | No, defaults to $r0 |
<fromsystem>
<src org="systemorg2" module="system\-(.+)"/>
<dest org="B" module="$m1"/>
</fromsystem>
Matches modules from systemorg2 which have a name beginning with system followed by a minus and anything else, and translate it to organisation B and module the part following system-
of the original name.