xmi 0.3.21 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +13 -6
- data/.gitignore +2 -1
- data/.rubocop.yml +12 -13
- data/.rubocop_todo.yml +150 -13
- data/CHANGELOG.md +55 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/Gemfile +10 -0
- data/README.adoc +319 -6
- data/benchmark_parse.rb +60 -0
- data/docs/migration.md +141 -0
- data/docs/versioning.md +255 -0
- data/lib/xmi/add.rb +14 -38
- data/lib/xmi/{the_custom_profile.rb → custom_profile.rb} +25 -25
- data/lib/xmi/delete.rb +14 -38
- data/lib/xmi/difference.rb +14 -38
- data/lib/xmi/documentation.rb +16 -101
- data/lib/xmi/ea_root.rb +114 -33
- data/lib/xmi/extension.rb +6 -6
- data/lib/xmi/namespace/dynamic.rb +28 -0
- data/lib/xmi/namespace/omg.rb +81 -0
- data/lib/xmi/namespace/sparx.rb +39 -0
- data/lib/xmi/namespace.rb +9 -0
- data/lib/xmi/namespace_detector.rb +138 -0
- data/lib/xmi/namespace_registry.rb +119 -0
- data/lib/xmi/parsing.rb +113 -0
- data/lib/xmi/replace.rb +14 -38
- data/lib/xmi/root.rb +49 -213
- data/lib/xmi/sparx/connector.rb +241 -0
- data/lib/xmi/sparx/custom_profile.rb +19 -0
- data/lib/xmi/sparx/diagram.rb +97 -0
- data/lib/xmi/sparx/ea_stub.rb +20 -0
- data/lib/xmi/{extensions/eauml.rb → sparx/ea_uml.rb} +3 -2
- data/lib/xmi/sparx/element.rb +453 -0
- data/lib/xmi/sparx/extension.rb +43 -0
- data/lib/xmi/{extensions → sparx}/gml.rb +9 -3
- data/lib/xmi/sparx/mappings/base_mapping.rb +182 -0
- data/lib/xmi/sparx/mappings.rb +10 -0
- data/lib/xmi/sparx/primitive_type.rb +18 -0
- data/lib/xmi/sparx/root.rb +60 -0
- data/lib/xmi/sparx/sys_ph_s.rb +18 -0
- data/lib/xmi/sparx.rb +17 -1376
- data/lib/xmi/type.rb +37 -0
- data/lib/xmi/uml.rb +191 -469
- data/lib/xmi/v20110701.rb +81 -0
- data/lib/xmi/v20131001.rb +68 -0
- data/lib/xmi/v20161101.rb +61 -0
- data/lib/xmi/version.rb +1 -1
- data/lib/xmi/version_registry.rb +164 -0
- data/lib/xmi/versioned.rb +142 -0
- data/lib/xmi.rb +83 -11
- data/scripts-xmi-profile/profile_xmi_simple.rb +213 -0
- data/xmi.gemspec +3 -9
- metadata +38 -77
data/lib/xmi/root.rb
CHANGED
|
@@ -4,231 +4,67 @@ require_relative "documentation"
|
|
|
4
4
|
require_relative "uml"
|
|
5
5
|
|
|
6
6
|
module Xmi
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
attribute :abstract, TheCustomProfile::Abstract, collection: true
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
end
|
|
7
|
+
class Root < Lutaml::Model::Serializable
|
|
8
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
9
|
+
attribute :label, ::Xmi::Type::XmiLabel
|
|
10
|
+
attribute :uuid, ::Xmi::Type::XmiUuid
|
|
11
|
+
attribute :href, :string
|
|
12
|
+
attribute :idref, ::Xmi::Type::XmiIdRef
|
|
13
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
14
|
+
attribute :documentation, Documentation
|
|
15
|
+
attribute :bibliography, CustomProfile::Bibliography, collection: true
|
|
16
|
+
attribute :basic_doc, CustomProfile::BasicDoc, collection: true
|
|
17
|
+
attribute :enumeration, CustomProfile::Enumeration, collection: true
|
|
18
|
+
attribute :ocl, CustomProfile::Ocl, collection: true
|
|
19
|
+
attribute :invariant, CustomProfile::Invariant, collection: true
|
|
20
|
+
attribute :publication_date, CustomProfile::PublicationDate,
|
|
21
|
+
collection: true
|
|
22
|
+
attribute :edition, CustomProfile::Edition, collection: true
|
|
23
|
+
attribute :number, CustomProfile::Number, collection: true
|
|
24
|
+
attribute :year_version, CustomProfile::YearVersion, collection: true
|
|
25
|
+
attribute :informative, CustomProfile::Informative, collection: true
|
|
26
|
+
attribute :persistence, CustomProfile::Persistence, collection: true
|
|
27
|
+
attribute :abstract, CustomProfile::Abstract, collection: true
|
|
32
28
|
|
|
33
|
-
class Root < Lutaml::Model::Serializable # rubocop:disable Metrics/ClassLength
|
|
34
|
-
include RootAttributes
|
|
35
29
|
attribute :model, Uml::UmlModel
|
|
36
30
|
|
|
37
|
-
xml do
|
|
31
|
+
xml do
|
|
38
32
|
root "XMI"
|
|
39
|
-
namespace
|
|
33
|
+
namespace ::Xmi::Namespace::Omg::Xmi
|
|
34
|
+
namespace_scope [
|
|
35
|
+
::Xmi::Namespace::Omg::Xmi,
|
|
36
|
+
::Xmi::Namespace::Omg::Uml,
|
|
37
|
+
::Xmi::Namespace::Omg::UmlDi,
|
|
38
|
+
::Xmi::Namespace::Omg::UmlDc,
|
|
39
|
+
::Xmi::Namespace::Sparx::Extension,
|
|
40
|
+
::Xmi::Namespace::Sparx::Gml,
|
|
41
|
+
::Xmi::Namespace::Sparx::CustomProfile,
|
|
42
|
+
::Xmi::Namespace::Sparx::SysPhS,
|
|
43
|
+
::Xmi::Namespace::Sparx::EaUml,
|
|
44
|
+
::Xmi::Namespace::Sparx::CityGml,
|
|
45
|
+
]
|
|
40
46
|
|
|
41
47
|
map_attribute "id", to: :id
|
|
42
48
|
map_attribute "label", to: :label
|
|
43
49
|
map_attribute "uuid", to: :uuid
|
|
44
|
-
map_attribute "href", to: :href
|
|
50
|
+
map_attribute "href", to: :href
|
|
45
51
|
map_attribute "idref", to: :idref
|
|
46
52
|
map_attribute "type", to: :type
|
|
47
53
|
|
|
48
54
|
map_element "Documentation", to: :documentation
|
|
49
|
-
map_element "Model", to: :model
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
map_element "
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
nil: :empty,
|
|
63
|
-
empty: :empty,
|
|
64
|
-
omitted: :empty
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
map_element "BasicDoc", to: :basic_doc,
|
|
68
|
-
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
|
69
|
-
prefix: "thecustomprofile",
|
|
70
|
-
value_map: {
|
|
71
|
-
from: {
|
|
72
|
-
nil: :empty,
|
|
73
|
-
empty: :empty,
|
|
74
|
-
omitted: :empty
|
|
75
|
-
},
|
|
76
|
-
to: {
|
|
77
|
-
nil: :empty,
|
|
78
|
-
empty: :empty,
|
|
79
|
-
omitted: :empty
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
map_element "enumeration", to: :enumeration,
|
|
83
|
-
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
|
84
|
-
prefix: "thecustomprofile",
|
|
85
|
-
value_map: {
|
|
86
|
-
from: {
|
|
87
|
-
nil: :empty,
|
|
88
|
-
empty: :empty,
|
|
89
|
-
omitted: :empty
|
|
90
|
-
},
|
|
91
|
-
to: {
|
|
92
|
-
nil: :empty,
|
|
93
|
-
empty: :empty,
|
|
94
|
-
omitted: :empty
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
map_element "OCL", to: :ocl,
|
|
98
|
-
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
|
99
|
-
prefix: "thecustomprofile",
|
|
100
|
-
value_map: {
|
|
101
|
-
from: {
|
|
102
|
-
nil: :empty,
|
|
103
|
-
empty: :empty,
|
|
104
|
-
omitted: :empty
|
|
105
|
-
},
|
|
106
|
-
to: {
|
|
107
|
-
nil: :empty,
|
|
108
|
-
empty: :empty,
|
|
109
|
-
omitted: :empty
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
map_element "invariant", to: :invariant,
|
|
113
|
-
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
|
114
|
-
prefix: "thecustomprofile",
|
|
115
|
-
value_map: {
|
|
116
|
-
from: {
|
|
117
|
-
nil: :empty,
|
|
118
|
-
empty: :empty,
|
|
119
|
-
omitted: :empty
|
|
120
|
-
},
|
|
121
|
-
to: {
|
|
122
|
-
nil: :empty,
|
|
123
|
-
empty: :empty,
|
|
124
|
-
omitted: :empty
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
map_element "publicationDate", to: :publication_date,
|
|
128
|
-
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
|
129
|
-
prefix: "thecustomprofile",
|
|
130
|
-
value_map: {
|
|
131
|
-
from: {
|
|
132
|
-
nil: :empty,
|
|
133
|
-
empty: :empty,
|
|
134
|
-
omitted: :empty
|
|
135
|
-
},
|
|
136
|
-
to: {
|
|
137
|
-
nil: :empty,
|
|
138
|
-
empty: :empty,
|
|
139
|
-
omitted: :empty
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
map_element "edition", to: :edition,
|
|
143
|
-
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
|
144
|
-
prefix: "thecustomprofile",
|
|
145
|
-
value_map: {
|
|
146
|
-
from: {
|
|
147
|
-
nil: :empty,
|
|
148
|
-
empty: :empty,
|
|
149
|
-
omitted: :empty
|
|
150
|
-
},
|
|
151
|
-
to: {
|
|
152
|
-
nil: :empty,
|
|
153
|
-
empty: :empty,
|
|
154
|
-
omitted: :empty
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
map_element "number", to: :number,
|
|
158
|
-
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
|
159
|
-
prefix: "thecustomprofile",
|
|
160
|
-
value_map: {
|
|
161
|
-
from: {
|
|
162
|
-
nil: :empty,
|
|
163
|
-
empty: :empty,
|
|
164
|
-
omitted: :empty
|
|
165
|
-
},
|
|
166
|
-
to: {
|
|
167
|
-
nil: :empty,
|
|
168
|
-
empty: :empty,
|
|
169
|
-
omitted: :empty
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
map_element "yearVersion", to: :year_version,
|
|
173
|
-
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
|
174
|
-
prefix: "thecustomprofile",
|
|
175
|
-
value_map: {
|
|
176
|
-
from: {
|
|
177
|
-
nil: :empty,
|
|
178
|
-
empty: :empty,
|
|
179
|
-
omitted: :empty
|
|
180
|
-
},
|
|
181
|
-
to: {
|
|
182
|
-
nil: :empty,
|
|
183
|
-
empty: :empty,
|
|
184
|
-
omitted: :empty
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
map_element "informative", to: :informative,
|
|
188
|
-
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
|
189
|
-
prefix: "thecustomprofile",
|
|
190
|
-
value_map: {
|
|
191
|
-
from: {
|
|
192
|
-
nil: :empty,
|
|
193
|
-
empty: :empty,
|
|
194
|
-
omitted: :empty
|
|
195
|
-
},
|
|
196
|
-
to: {
|
|
197
|
-
nil: :empty,
|
|
198
|
-
empty: :empty,
|
|
199
|
-
omitted: :empty
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
map_element "persistence", to: :persistence,
|
|
203
|
-
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
|
204
|
-
prefix: "thecustomprofile",
|
|
205
|
-
value_map: {
|
|
206
|
-
from: {
|
|
207
|
-
nil: :empty,
|
|
208
|
-
empty: :empty,
|
|
209
|
-
omitted: :empty
|
|
210
|
-
},
|
|
211
|
-
to: {
|
|
212
|
-
nil: :empty,
|
|
213
|
-
empty: :empty,
|
|
214
|
-
omitted: :empty
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
map_element "Abstract", to: :abstract,
|
|
218
|
-
namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
|
|
219
|
-
prefix: "thecustomprofile",
|
|
220
|
-
value_map: {
|
|
221
|
-
from: {
|
|
222
|
-
nil: :empty,
|
|
223
|
-
empty: :empty,
|
|
224
|
-
omitted: :empty
|
|
225
|
-
},
|
|
226
|
-
to: {
|
|
227
|
-
nil: :empty,
|
|
228
|
-
empty: :empty,
|
|
229
|
-
omitted: :empty
|
|
230
|
-
}
|
|
231
|
-
}
|
|
55
|
+
map_element "Model", to: :model
|
|
56
|
+
map_element "Bibliography", to: :bibliography, value_map: VALUE_MAP
|
|
57
|
+
map_element "BasicDoc", to: :basic_doc, value_map: VALUE_MAP
|
|
58
|
+
map_element "enumeration", to: :enumeration, value_map: VALUE_MAP
|
|
59
|
+
map_element "OCL", to: :ocl, value_map: VALUE_MAP
|
|
60
|
+
map_element "invariant", to: :invariant, value_map: VALUE_MAP
|
|
61
|
+
map_element "publicationDate", to: :publication_date, value_map: VALUE_MAP
|
|
62
|
+
map_element "edition", to: :edition, value_map: VALUE_MAP
|
|
63
|
+
map_element "number", to: :number, value_map: VALUE_MAP
|
|
64
|
+
map_element "yearVersion", to: :year_version, value_map: VALUE_MAP
|
|
65
|
+
map_element "informative", to: :informative, value_map: VALUE_MAP
|
|
66
|
+
map_element "persistence", to: :persistence, value_map: VALUE_MAP
|
|
67
|
+
map_element "Abstract", to: :abstract, value_map: VALUE_MAP
|
|
232
68
|
end
|
|
233
69
|
end
|
|
234
70
|
end
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Sparx
|
|
5
|
+
module Connector
|
|
6
|
+
class Model < Lutaml::Model::Serializable
|
|
7
|
+
attribute :ea_localid, :string
|
|
8
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
9
|
+
attribute :name, :string
|
|
10
|
+
|
|
11
|
+
xml do
|
|
12
|
+
map_attribute "ea_localid", to: :ea_localid
|
|
13
|
+
map_attribute "type", to: :type
|
|
14
|
+
map_attribute "name", to: :name
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
class EndRole < Lutaml::Model::Serializable
|
|
19
|
+
attribute :name, :string
|
|
20
|
+
attribute :visibility, :string
|
|
21
|
+
attribute :target_scope, :string
|
|
22
|
+
|
|
23
|
+
xml do
|
|
24
|
+
root "role"
|
|
25
|
+
|
|
26
|
+
map_attribute :name, to: :name
|
|
27
|
+
map_attribute :visibility, to: :visibility
|
|
28
|
+
map_attribute :targetScope, to: :target_scope
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
class EndType < Lutaml::Model::Serializable
|
|
33
|
+
attribute :aggregation, :string
|
|
34
|
+
attribute :multiplicity, :string
|
|
35
|
+
attribute :containment, :string
|
|
36
|
+
|
|
37
|
+
xml do
|
|
38
|
+
root "type"
|
|
39
|
+
|
|
40
|
+
map_attribute :aggregation, to: :aggregation
|
|
41
|
+
map_attribute :multiplicity, to: :multiplicity
|
|
42
|
+
map_attribute :containment, to: :containment
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
class EndModifiers < Lutaml::Model::Serializable
|
|
47
|
+
attribute :is_ordered, :boolean
|
|
48
|
+
attribute :is_navigable, :boolean
|
|
49
|
+
|
|
50
|
+
xml do
|
|
51
|
+
root "type"
|
|
52
|
+
|
|
53
|
+
map_attribute "isOrdered", to: :is_ordered
|
|
54
|
+
map_attribute "isNavigable", to: :is_navigable
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
class EndConstraint < Lutaml::Model::Serializable
|
|
59
|
+
attribute :name, :string
|
|
60
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
61
|
+
attribute :weight, :float
|
|
62
|
+
attribute :status, :string
|
|
63
|
+
|
|
64
|
+
xml do
|
|
65
|
+
root "constraint"
|
|
66
|
+
|
|
67
|
+
map_attribute "name", to: :name
|
|
68
|
+
map_attribute "type", to: :type
|
|
69
|
+
map_attribute "weight", to: :weight
|
|
70
|
+
map_attribute "status", to: :status
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
class EndConstraints < Lutaml::Model::Serializable
|
|
75
|
+
attribute :constraint, EndConstraint, collection: true
|
|
76
|
+
|
|
77
|
+
xml do
|
|
78
|
+
root "constraints"
|
|
79
|
+
|
|
80
|
+
map_element "constraint", to: :constraint, value_map: VALUE_MAP
|
|
81
|
+
end
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
class EndStyle < Lutaml::Model::Serializable
|
|
85
|
+
attribute :value, :string
|
|
86
|
+
|
|
87
|
+
xml do
|
|
88
|
+
root "style"
|
|
89
|
+
|
|
90
|
+
map_attribute "value", to: :value
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
class End < Lutaml::Model::Serializable
|
|
95
|
+
attribute :idref, ::Xmi::Type::XmiIdRef
|
|
96
|
+
attribute :model, Model
|
|
97
|
+
attribute :role, EndRole
|
|
98
|
+
attribute :type, EndType
|
|
99
|
+
attribute :constraints, EndConstraints
|
|
100
|
+
attribute :modifiers, EndModifiers
|
|
101
|
+
attribute :style, EndStyle
|
|
102
|
+
attribute :documentation, Element::Documentation
|
|
103
|
+
attribute :xrefs, Element::Xrefs
|
|
104
|
+
attribute :tags, Element::Tags
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
class Source < End
|
|
108
|
+
xml do
|
|
109
|
+
root "source"
|
|
110
|
+
|
|
111
|
+
map_attribute "idref", to: :idref
|
|
112
|
+
|
|
113
|
+
map_element "model", to: :model, render_nil: true
|
|
114
|
+
map_element "role", to: :role, render_nil: true
|
|
115
|
+
map_element "type", to: :type, render_nil: true
|
|
116
|
+
map_element "constraints", to: :constraints, render_nil: true
|
|
117
|
+
map_element "modifiers", to: :modifiers, render_nil: true
|
|
118
|
+
map_element "style", to: :style, render_nil: true
|
|
119
|
+
map_element "documentation", to: :documentation, value_map: VALUE_MAP
|
|
120
|
+
map_element "xrefs", to: :xrefs, render_nil: true
|
|
121
|
+
map_element "tags", to: :tags, render_nil: true
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
class Target < End
|
|
126
|
+
xml do
|
|
127
|
+
root "target"
|
|
128
|
+
|
|
129
|
+
map_attribute "idref", to: :idref
|
|
130
|
+
|
|
131
|
+
map_element "model", to: :model, render_nil: true
|
|
132
|
+
map_element "role", to: :role, render_nil: true
|
|
133
|
+
map_element "type", to: :type, render_nil: true
|
|
134
|
+
map_element "constraints", to: :constraints, render_nil: true
|
|
135
|
+
map_element "modifiers", to: :modifiers, render_nil: true
|
|
136
|
+
map_element "style", to: :style, render_nil: true
|
|
137
|
+
map_element "documentation", to: :documentation, value_map: VALUE_MAP
|
|
138
|
+
map_element "xrefs", to: :xrefs, render_nil: true
|
|
139
|
+
map_element "tags", to: :tags, render_nil: true
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
class Properties < Lutaml::Model::Serializable
|
|
144
|
+
attribute :ea_type, :string
|
|
145
|
+
attribute :direction, :string
|
|
146
|
+
|
|
147
|
+
xml do
|
|
148
|
+
root "properties"
|
|
149
|
+
|
|
150
|
+
map_attribute :ea_type, to: :ea_type
|
|
151
|
+
map_attribute :direction, to: :direction
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
class Appearance < Lutaml::Model::Serializable
|
|
156
|
+
attribute :linemode, :integer
|
|
157
|
+
attribute :linecolor, :integer
|
|
158
|
+
attribute :linewidth, :integer
|
|
159
|
+
attribute :seqno, :integer
|
|
160
|
+
attribute :headStyle, :integer
|
|
161
|
+
attribute :lineStyle, :integer
|
|
162
|
+
|
|
163
|
+
xml do
|
|
164
|
+
root "appearance"
|
|
165
|
+
|
|
166
|
+
map_attribute :linemode, to: :linemode
|
|
167
|
+
map_attribute :linecolor, to: :linecolor
|
|
168
|
+
map_attribute :linewidth, to: :linewidth
|
|
169
|
+
map_attribute :seqno, to: :seqno
|
|
170
|
+
map_attribute :headStyle, to: :headStyle
|
|
171
|
+
map_attribute :lineStyle, to: :lineStyle
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
class Labels < Lutaml::Model::Serializable
|
|
176
|
+
attribute :rb, :string
|
|
177
|
+
attribute :lb, :string
|
|
178
|
+
attribute :mb, :string
|
|
179
|
+
attribute :rt, :string
|
|
180
|
+
attribute :lt, :string
|
|
181
|
+
attribute :mt, :string
|
|
182
|
+
|
|
183
|
+
xml do
|
|
184
|
+
root "labels"
|
|
185
|
+
|
|
186
|
+
map_attribute :rb, to: :rb
|
|
187
|
+
map_attribute :lb, to: :lb
|
|
188
|
+
map_attribute :mb, to: :mb
|
|
189
|
+
map_attribute :rt, to: :rt
|
|
190
|
+
map_attribute :lt, to: :lt
|
|
191
|
+
map_attribute :mt, to: :mt
|
|
192
|
+
end
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
class Connector < Lutaml::Model::Serializable
|
|
196
|
+
attribute :name, :string
|
|
197
|
+
attribute :idref, :string
|
|
198
|
+
attribute :source, Source
|
|
199
|
+
attribute :target, Target
|
|
200
|
+
attribute :model, Model
|
|
201
|
+
attribute :properties, Properties
|
|
202
|
+
attribute :documentation, Element::Documentation
|
|
203
|
+
attribute :appearance, Appearance
|
|
204
|
+
attribute :labels, Labels
|
|
205
|
+
attribute :extended_properties, Element::ExtendedProperties
|
|
206
|
+
attribute :style, Element::Style
|
|
207
|
+
attribute :tags, Element::Tags
|
|
208
|
+
attribute :xrefs, Element::Xrefs
|
|
209
|
+
|
|
210
|
+
xml do
|
|
211
|
+
root "element"
|
|
212
|
+
|
|
213
|
+
map_attribute "name", to: :name
|
|
214
|
+
map_attribute "idref", to: :idref
|
|
215
|
+
|
|
216
|
+
map_element "source", to: :source
|
|
217
|
+
map_element "target", to: :target
|
|
218
|
+
map_element "model", to: :model
|
|
219
|
+
map_element "properties", to: :properties
|
|
220
|
+
map_element "documentation", to: :documentation, value_map: VALUE_MAP
|
|
221
|
+
map_element "appearance", to: :appearance
|
|
222
|
+
map_element "labels", to: :labels, render_nil: true
|
|
223
|
+
map_element "extendedProperties", to: :extended_properties
|
|
224
|
+
map_element "style", to: :style, render_nil: true
|
|
225
|
+
map_element "xrefs", to: :xrefs, render_nil: true
|
|
226
|
+
map_element "tags", to: :tags, render_nil: true
|
|
227
|
+
end
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
class Connectors < Lutaml::Model::Serializable
|
|
231
|
+
attribute :connector, Connector, collection: true
|
|
232
|
+
|
|
233
|
+
xml do
|
|
234
|
+
root "connectors"
|
|
235
|
+
|
|
236
|
+
map_element "connector", to: :connector, value_map: VALUE_MAP
|
|
237
|
+
end
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
end
|
|
241
|
+
end
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Sparx
|
|
5
|
+
module CustomProfile
|
|
6
|
+
# Contains UML Profile definitions
|
|
7
|
+
# Note: PublicationDate, Edition, Number, YearVersion are defined in Xmi::CustomProfile
|
|
8
|
+
class Profiles < Lutaml::Model::Serializable
|
|
9
|
+
attribute :profile, Uml::Profile, collection: true
|
|
10
|
+
|
|
11
|
+
xml do
|
|
12
|
+
root "profiles"
|
|
13
|
+
|
|
14
|
+
map_element "Profile", to: :profile, value_map: VALUE_MAP
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Sparx
|
|
5
|
+
module Diagram
|
|
6
|
+
class Element < Lutaml::Model::Serializable
|
|
7
|
+
attribute :geometry, :string
|
|
8
|
+
attribute :subject, :string
|
|
9
|
+
attribute :seqno, :integer
|
|
10
|
+
attribute :style, :string
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
root "element"
|
|
14
|
+
|
|
15
|
+
map_attribute "geometry", to: :geometry
|
|
16
|
+
map_attribute "subject", to: :subject
|
|
17
|
+
map_attribute "seqno", to: :seqno
|
|
18
|
+
map_attribute "style", to: :style
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
class Elements < Lutaml::Model::Serializable
|
|
23
|
+
attribute :element, Element, collection: true
|
|
24
|
+
|
|
25
|
+
xml do
|
|
26
|
+
root "elements"
|
|
27
|
+
|
|
28
|
+
map_element "element", to: :element, value_map: VALUE_MAP
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
class Model < Lutaml::Model::Serializable
|
|
33
|
+
attribute :package, :string
|
|
34
|
+
attribute :local_id, :string
|
|
35
|
+
attribute :owner, :string
|
|
36
|
+
|
|
37
|
+
xml do
|
|
38
|
+
root "model"
|
|
39
|
+
|
|
40
|
+
map_attribute "package", to: :package
|
|
41
|
+
map_attribute "localID", to: :local_id
|
|
42
|
+
map_attribute "owner", to: :owner
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
class Style < Lutaml::Model::Serializable
|
|
47
|
+
attribute :value, :string
|
|
48
|
+
|
|
49
|
+
xml do
|
|
50
|
+
map_attribute "value", to: :value
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
class Diagram < Lutaml::Model::Serializable
|
|
55
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
56
|
+
attribute :model, Model
|
|
57
|
+
attribute :properties, Sparx::Element::Properties
|
|
58
|
+
attribute :project, Sparx::Element::Project
|
|
59
|
+
attribute :style1, Style
|
|
60
|
+
attribute :style2, Style
|
|
61
|
+
attribute :swimlanes, Style
|
|
62
|
+
attribute :matrixitems, Style
|
|
63
|
+
attribute :extended_properties, Sparx::Element::ExtendedProperties
|
|
64
|
+
attribute :xrefs, Sparx::Element::Xrefs
|
|
65
|
+
attribute :elements, Elements
|
|
66
|
+
|
|
67
|
+
xml do
|
|
68
|
+
root "diagram"
|
|
69
|
+
|
|
70
|
+
map_attribute "id", to: :id
|
|
71
|
+
|
|
72
|
+
map_element "model", to: :model
|
|
73
|
+
map_element "properties", to: :properties
|
|
74
|
+
map_element "project", to: :project
|
|
75
|
+
map_element "style1", to: :style1, render_nil: true
|
|
76
|
+
map_element "style2", to: :style2, render_nil: true
|
|
77
|
+
map_element "swimlanes", to: :swimlanes, render_nil: true
|
|
78
|
+
map_element "matrixitems", to: :matrixitems, render_nil: true
|
|
79
|
+
map_element "extendedProperties", to: :extended_properties,
|
|
80
|
+
render_nil: true
|
|
81
|
+
map_element "xrefs", to: :xrefs, render_nil: true
|
|
82
|
+
map_element "elements", to: :elements
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
class Diagrams < Lutaml::Model::Serializable
|
|
87
|
+
attribute :diagram, Diagram, collection: true
|
|
88
|
+
|
|
89
|
+
xml do
|
|
90
|
+
root "diagrams"
|
|
91
|
+
|
|
92
|
+
map_element "diagram", to: :diagram, value_map: VALUE_MAP
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Sparx
|
|
5
|
+
class EaStub < Lutaml::Model::Serializable
|
|
6
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
7
|
+
attribute :name, :string
|
|
8
|
+
attribute :uml_type, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
root "EAStub"
|
|
12
|
+
namespace ::Xmi::Namespace::Omg::Xmi
|
|
13
|
+
|
|
14
|
+
map_attribute "id", to: :id
|
|
15
|
+
map_attribute "name", to: :name
|
|
16
|
+
map_attribute "UMLType", to: :uml_type
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module Xmi
|
|
4
|
-
|
|
5
|
-
module
|
|
4
|
+
module Sparx
|
|
5
|
+
module EaUml
|
|
6
6
|
class Import < Lutaml::Model::Serializable
|
|
7
7
|
attribute :base_package_import, :string
|
|
8
8
|
|
|
9
9
|
xml do
|
|
10
10
|
root "import"
|
|
11
|
+
namespace ::Xmi::Namespace::Sparx::EaUml
|
|
11
12
|
|
|
12
13
|
map_attribute "base_PackageImport", to: :base_package_import
|
|
13
14
|
end
|