1 package SQL::Translator::XMI::Parser::V12;
3 # -------------------------------------------------------------------
5 # -------------------------------------------------------------------
6 # Copyright (C) 2003 Mark Addison <mark.addison@itn.co.uk>,
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; version 2.
12 # This program is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 # General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
21 # -------------------------------------------------------------------
27 SQL::Translator::XMI::Parser::V12 - Version 1.2 parser.
34 use base qw(SQL::Translator::XMI::Parser);
38 $spec12->{taggedValue} = {
39 name => "taggedValue",
40 plural => "taggedValues",
41 default_path => '//UML:TaggedValue[@xmi.id]',
42 attrib_data => [qw/isSpecification/],
46 path => 'UML:TaggedValue.dataValue/text()',
50 path => 'xmiDeref(UML:TaggedValue.type/UML:TagDefinition)/@name',
59 default_path => '//UML:Class[@xmi.id]',
61 [qw/name visibility isSpecification isRoot isLeaf isAbstract isActive/],
65 path => 'xmiDeref(UML:ModelElement.stereotype/UML:Stereotype)/@name',
72 # name in data returned
73 path => "UML:Classifier.feature/UML:Attribute",
75 # Points to class in spec. get_attributes() called to parse it and
76 # adds filter_attributes to the args for get_classes().
78 # How many we get back. Use '1' for 1 and '*' for lots.
79 # TODO If not set then decide depening on the return?
83 path => "UML:Classifier.feature/UML:Operation",
88 name => "taggedValues",
89 path => 'UML:ModelElement.taggedValue/UML:TaggedValue',
90 class => "taggedValue",
93 # Add a _map_taggedValues to the data. Its a hash of the name data
94 # which refs the normal list of kids
97 name => "associationEnds",
98 path => '//UML:AssociationEnd.participant/UML:Class[@xmi.idref="${xmi.id}"]/../..',
99 # ${xmi.id} is a variable sub from the data defined for this thing.
100 # Not standard XPath! Done in the get sub
101 class => "AssociationEnd",
107 $spec12->{attribute} = {
109 plural => "attributes",
110 default_path => '//UML:Classifier.feature/UML:Attribute[@xmi.id]',
112 [qw/name visibility isSpecification ownerScope/],
115 name => "stereotype",
116 path => 'xmiDeref(UML:ModelElement.stereotype/UML:Stereotype)/@name',
120 name => "initialValue",
121 path => 'UML:Attribute.initialValue/UML:Expression/@body',
126 name => "taggedValues",
127 path => 'UML:ModelElement.taggedValue/UML:TaggedValue',
128 class => "taggedValue",
134 path => 'xmiDeref(UML:StructuralFeature.type/UML:DataType)',
141 $spec12->{dataType} = {
143 plural => "datatypes",
145 default_path => '//UML:DataType[@xmi.id]',
147 [qw/name visibility isSpecification isRoot isLeaf isAbstract/],
150 name => "stereotype",
151 path => 'xmiDeref(UML:ModelElement.stereotype/UML:Stereotype)/@name',
157 name => "taggedValues",
158 path => 'UML:ModelElement.taggedValue/UML:TaggedValue',
159 class => "taggedValue",
168 $spec12->{operation} = {
170 plural => "operations",
171 default_path => '//UML:Classifier.feature/UML:Operation[@xmi.id]',
173 [qw/name visibility isSpecification ownerScope isQuery
174 concurrency isRoot isLeaf isAbstract/],
177 name => "stereotype",
178 path => 'xmiDeref(UML:ModelElement.stereotype/UML:Stereotype)/@name',
184 name => "parameters",
185 path => "UML:BehavioralFeature.parameter/UML:Parameter",
186 class => "parameter",
190 name => "taggedValues",
191 path => 'UML:ModelElement.taggedValue/UML:TaggedValue',
192 class => "taggedValue",
199 $spec12->{parameter} = {
201 plural => "parameters",
202 default_path => '//UML:Parameter[@xmi.id]',
203 attrib_data => [qw/name isSpecification kind/],
206 name => "stereotype",
207 path => 'xmiDeref(UML:ModelElement.stereotype/UML:Stereotype)/@name',
212 path => 'xmiDeref(UML:StructuralFeature.type/UML:DataType)/@name',
217 $spec12->{association} = {
218 name => "association",
219 plural => "associations",
221 default_path => '//UML:Association[@xmi.id]',
222 attrib_data => [qw/name visibility isSpecification isNavigable ordering aggregation targetScope changeability/],
225 name => "stereotype",
226 path => 'xmiDeref(UML:ModelElement.stereotype/UML:Stereotype)/@name',
232 name => "associationEnds",
233 path => "UML:Association.connection/UML:AssociationEnd",
234 class => "AssociationEnd",
240 $spec12->{AssociationEnd} = {
243 default_path => '//UML:AssociationEnd',
244 attrib_data => [qw/name visibility isSpecification isNavigable ordering aggregation targetScope changeability/],
247 name => "stereotype",
248 path => 'xmiDeref(UML:ModelElement.stereotype/UML:Stereotype)/@name',
253 path => 'xmiDeref(UML:AssociationEnd.participant/UML:Class)/@name',
259 name => "association",
261 class => "association",
265 name => "participant",
266 path => "xmiDeref(UML:AssociationEnd.participant/UML:Class)",
271 name => "multiplicity",
272 #path => "xmiDeref(UML:AssociationEnd.multiplicity/UML:Multiplicity)",
273 path => 'UML:AssociationEnd.multiplicity/UML:Multiplicity',
274 class => "multiplicity",
280 $spec12->{multiplicity} = {
281 name => "multiplicity",
282 plural => "multiplicities",
283 default_path => '//UML:Multiplicity[@xmi.id]',
284 attrib_data => [qw//],
287 name => "rangeLower",
288 path => 'xmiDeref(UML:Multiplicity.range/UML:MultiplicityRange)/@lower',
291 name => "rangeUpper",
292 path => 'xmiDeref(UML:Multiplicity.range/UML:MultiplicityRange)/@upper',
297 # Set the spec and have the get_* methods generated
298 __PACKAGE__->XmiSpec($spec12);
301 1; #===========================================================================
317 =head1 VERSION HISTORY
321 grommit <mark.addison@itn.co.uk>