Commit | Line | Data |
93f4a354 |
1 | package SQL::Translator::XMI::Parser::V10; |
2 | |
3 | # ------------------------------------------------------------------- |
821a0fde |
4 | # $Id$ |
93f4a354 |
5 | # ------------------------------------------------------------------- |
6 | # Copyright (C) 2003 Mark Addison <mark.addison@itn.co.uk>, |
7 | # |
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. |
11 | # |
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. |
16 | # |
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 |
20 | # 02111-1307 USA |
21 | # ------------------------------------------------------------------- |
22 | |
23 | =pod |
24 | |
25 | =head1 NAME |
26 | |
27 | SQL::Translator::XMI::Parser::V10 - Version 1.0 parser. |
28 | |
29 | =cut |
30 | |
31 | use strict; |
32 | use 5.006_001; |
93f4a354 |
33 | |
34 | use base qw(SQL::Translator::XMI::Parser); |
35 | |
36 | my $spec10 = {}; |
37 | |
38 | $spec10->{class} = { |
39 | name => "class", |
40 | plural => "classes", |
41 | isRoot => 1, |
42 | default_path => '//Foundation.Core.Class[@xmi.id]', |
43 | attrib_data => [], |
44 | path_data => [ |
45 | { |
46 | name => "name", |
47 | path => 'Foundation.Core.ModelElement.name/text()', |
48 | }, |
49 | { |
50 | name => "visibility", |
51 | path => 'Foundation.Core.ModelElement.visibility/@xmi.value', |
52 | }, |
53 | { |
54 | name => "isSpecification", |
55 | path => 'Foundation.Core.ModelElement.isSpecification/@xmi.value', |
56 | }, |
57 | { |
58 | name => "isRoot", |
59 | path => 'Foundation.Core.GeneralizableElement.isRoot/@xmi.value', |
60 | }, |
61 | { |
62 | name => "isLeaf", |
63 | path => 'Foundation.Core.GeneralizableElement.isLeaf/@xmi.value', |
64 | }, |
65 | { |
66 | name => "isAbstract", |
67 | path => 'Foundation.Core.GeneralizableElement.isAbstract/@xmi.value', |
68 | }, |
69 | { |
70 | name => "isActive", |
71 | path => 'Foundation.Core.Class.isActive/@xmi.value', |
72 | }, |
73 | ], |
74 | kids => [ |
75 | { |
76 | name => "attributes", |
77 | path => |
78 | 'Foundation.Core.Classifier.feature/Foundation.Core.Attribute', |
79 | class => "attribute", |
80 | multiplicity => "*", |
81 | }, |
82 | # { |
83 | # name => "operations", |
84 | # path => "UML:Classifier.feature/UML:Operation", |
85 | # class => "operation", |
86 | # multiplicity => "*", |
87 | # }, |
88 | ], |
89 | }; |
90 | |
91 | $spec10->{attribute} = { |
92 | name => "attribute", |
93 | plural => "attributes", |
94 | default_path => '//Foundation.Core.Attribute[@xmi.id]', |
95 | path_data => [ |
96 | { |
97 | name => "name", |
98 | path => 'Foundation.Core.ModelElement.name/text()', |
99 | }, |
100 | { |
101 | name => "visibility", |
102 | path => 'Foundation.Core.ModelElement.visibility/@xmi.value', |
103 | }, |
104 | { |
105 | name => "isSpecification", |
106 | path => 'Foundation.Core.ModelElement.isSpecification/@xmi.value', |
107 | }, |
108 | { |
109 | name => "ownerScope", |
110 | path => 'Foundation.Core.Feature.ownerScope/@xmi.value', |
111 | }, |
112 | { |
113 | name => "initialValue", |
114 | path => 'Foundation.Core.Attribute.initialValue/Foundation.Data_Types.Expression/Foundation.Data_Types.Expression.body/text()', |
115 | }, |
116 | #{ |
117 | # name => "datatype", |
118 | # path => 'xmiDeref(Foundation.Core.StructuralFeature.type/Foundation.Core.Classifier)/Foundation.Core.DataType/Foundation.Core.ModelElement.name/text()', |
119 | #}, |
120 | ], |
121 | }; |
122 | |
123 | __PACKAGE__->XmiSpec($spec10); |
124 | |
125 | #----------------------------------------------------------------------------- |
126 | |
127 | sub get_classes { |
128 | print "******************* HELLO 1.0 ********************\n"; |
129 | shift->_get_classes(@_); |
130 | } |
131 | |
132 | 1; #=========================================================================== |
133 | |
134 | __END__ |
135 | |
136 | =head1 SYNOPSIS |
137 | |
138 | =head1 DESCRIPTION |
139 | |
140 | =head1 SEE ALSO |
141 | |
142 | perl(1). |
143 | |
144 | =head1 TODO |
145 | |
146 | =head1 BUGS |
147 | |
148 | =head1 VERSION HISTORY |
149 | |
150 | =head1 AUTHOR |
151 | |
152 | grommit <mark.addison@itn.co.uk> |
153 | |
154 | =head1 LICENSE |
155 | |
156 | This package is free software and is provided "as is" without express or |
157 | implied warranty. It may be used, redistributed and/or modified under the |
158 | terms of either; |
159 | |
160 | a) the Perl Artistic License. |
161 | |
162 | See F<http://www.perl.com/perl/misc/Artistic.html> |
163 | |
164 | b) the terms of the GNU General Public License as published by the Free Software |
165 | Foundation; either version 1, or (at your option) any later version. |
166 | |
167 | =cut |