xmi 0.3.11 → 0.3.13

Sign up to get free protection for your applications and to get access to all the features.
data/lib/xmi/sparx.rb CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Xmi
4
4
  module Sparx
5
- class SparxElementDocumentation < Shale::Mapper
6
- attribute :value, Shale::Type::String
5
+ class SparxElementDocumentation < Lutaml::Model::Serializable
6
+ attribute :value, :string
7
7
 
8
8
  xml do
9
9
  root "documentation"
@@ -12,12 +12,12 @@ module Xmi
12
12
  end
13
13
  end
14
14
 
15
- class SparxElementModel < Shale::Mapper
16
- attribute :package, Shale::Type::String
17
- attribute :package2, Shale::Type::String
18
- attribute :tpos, Shale::Type::Integer
19
- attribute :ea_localid, Shale::Type::String
20
- attribute :ea_eleType, Shale::Type::String
15
+ class SparxElementModel < Lutaml::Model::Serializable
16
+ attribute :package, :string
17
+ attribute :package2, :string
18
+ attribute :tpos, :integer
19
+ attribute :ea_localid, :string
20
+ attribute :ea_eleType, :string
21
21
 
22
22
  xml do
23
23
  root "model"
@@ -30,20 +30,20 @@ module Xmi
30
30
  end
31
31
  end
32
32
 
33
- class SparxElementProperties < Shale::Mapper
34
- attribute :name, Shale::Type::String
35
- attribute :type, Shale::Type::String
36
- attribute :is_specification, Shale::Type::Boolean
37
- attribute :is_root, Shale::Type::Boolean
38
- attribute :is_leaf, Shale::Type::Boolean
39
- attribute :is_abstract, Shale::Type::Boolean
40
- attribute :is_active, Shale::Type::Boolean
41
- attribute :s_type, Shale::Type::String
42
- attribute :n_type, Shale::Type::String
43
- attribute :scope, Shale::Type::String
44
- attribute :stereotype, Shale::Type::String
45
- attribute :alias, Shale::Type::String
46
- attribute :documentation, Shale::Type::String
33
+ class SparxElementProperties < Lutaml::Model::Serializable
34
+ attribute :name, :string
35
+ attribute :type, :string
36
+ attribute :is_specification, :boolean
37
+ attribute :is_root, :boolean
38
+ attribute :is_leaf, :boolean
39
+ attribute :is_abstract, :boolean
40
+ attribute :is_active, :boolean
41
+ attribute :s_type, :string
42
+ attribute :n_type, :string
43
+ attribute :scope, :string
44
+ attribute :stereotype, :string
45
+ attribute :alias, :string
46
+ attribute :documentation, :string
47
47
 
48
48
  xml do
49
49
  root "properties"
@@ -64,14 +64,14 @@ module Xmi
64
64
  end
65
65
  end
66
66
 
67
- class SparxElementProject < Shale::Mapper
68
- attribute :author, Shale::Type::String
69
- attribute :version, Shale::Type::String
70
- attribute :phase, Shale::Type::String
71
- attribute :created, Shale::Type::String
72
- attribute :modified, Shale::Type::String
73
- attribute :complexity, Shale::Type::Integer
74
- attribute :status, Shale::Type::String
67
+ class SparxElementProject < Lutaml::Model::Serializable
68
+ attribute :author, :string
69
+ attribute :version, :string
70
+ attribute :phase, :string
71
+ attribute :created, :string
72
+ attribute :modified, :string
73
+ attribute :complexity, :integer
74
+ attribute :status, :string
75
75
 
76
76
  xml do
77
77
  root "project"
@@ -86,9 +86,9 @@ module Xmi
86
86
  end
87
87
  end
88
88
 
89
- class SparxElementCode < Shale::Mapper
90
- attribute :gentype, Shale::Type::String
91
- attribute :product_name, Shale::Type::String
89
+ class SparxElementCode < Lutaml::Model::Serializable
90
+ attribute :gentype, :string
91
+ attribute :product_name, :string
92
92
 
93
93
  xml do
94
94
  root "code"
@@ -98,8 +98,8 @@ module Xmi
98
98
  end
99
99
  end
100
100
 
101
- class SparxElementStyle < Shale::Mapper
102
- attribute :appearance, Shale::Type::String
101
+ class SparxElementStyle < Lutaml::Model::Serializable
102
+ attribute :appearance, :string
103
103
 
104
104
  xml do
105
105
  root "style"
@@ -108,11 +108,11 @@ module Xmi
108
108
  end
109
109
  end
110
110
 
111
- class SparxElementTag < Shale::Mapper
112
- attribute :id, Shale::Type::String
113
- attribute :name, Shale::Type::String
114
- attribute :value, Shale::Type::String
115
- attribute :model_element, Shale::Type::String
111
+ class SparxElementTag < Lutaml::Model::Serializable
112
+ attribute :id, :string
113
+ attribute :name, :string
114
+ attribute :value, :string
115
+ attribute :model_element, :string
116
116
 
117
117
  xml do
118
118
  root "tag"
@@ -124,17 +124,17 @@ module Xmi
124
124
  end
125
125
  end
126
126
 
127
- class SparxElementTags < Shale::Mapper
127
+ class SparxElementTags < Lutaml::Model::Serializable
128
128
  attribute :tags, SparxElementTag, collection: true
129
129
 
130
130
  xml do
131
131
  root "tags"
132
- map_element "tag", to: :tags
132
+ map_element "tag", to: :tags, namespace: nil, prefix: nil
133
133
  end
134
134
  end
135
135
 
136
- class SparxElementXrefs < Shale::Mapper
137
- attribute :value, Shale::Type::String
136
+ class SparxElementXrefs < Lutaml::Model::Serializable
137
+ attribute :value, :string
138
138
 
139
139
  xml do
140
140
  root "xrefs"
@@ -143,10 +143,10 @@ module Xmi
143
143
  end
144
144
  end
145
145
 
146
- class SparxElementExtendedProperties < Shale::Mapper
147
- attribute :tagged, Shale::Type::String
148
- attribute :package_name, Shale::Type::String
149
- attribute :virtual_inheritance, Shale::Type::Integer
146
+ class SparxElementExtendedProperties < Lutaml::Model::Serializable
147
+ attribute :tagged, :string
148
+ attribute :package_name, :string
149
+ attribute :virtual_inheritance, :integer
150
150
 
151
151
  xml do
152
152
  root "extendedProperties"
@@ -157,10 +157,10 @@ module Xmi
157
157
  end
158
158
  end
159
159
 
160
- class SparxElementPackageProperties < Shale::Mapper
161
- attribute :version, Shale::Type::String
162
- attribute :xmiver, Shale::Type::String
163
- attribute :tpos, Shale::Type::String
160
+ class SparxElementPackageProperties < Lutaml::Model::Serializable
161
+ attribute :version, :string
162
+ attribute :xmiver, :string
163
+ attribute :tpos, :string
164
164
 
165
165
  xml do
166
166
  root "packagedproperties"
@@ -171,8 +171,8 @@ module Xmi
171
171
  end
172
172
  end
173
173
 
174
- class SparxElementPaths < Shale::Mapper
175
- attribute :xmlpath, Shale::Type::String
174
+ class SparxElementPaths < Lutaml::Model::Serializable
175
+ attribute :xmlpath, :string
176
176
 
177
177
  xml do
178
178
  root "paths"
@@ -181,11 +181,11 @@ module Xmi
181
181
  end
182
182
  end
183
183
 
184
- class SparxElementTimes < Shale::Mapper
185
- attribute :created, Shale::Type::String
186
- attribute :modified, Shale::Type::String
187
- attribute :last_load_date, Shale::Type::String
188
- attribute :last_save_date, Shale::Type::String
184
+ class SparxElementTimes < Lutaml::Model::Serializable
185
+ attribute :created, :string
186
+ attribute :modified, :string
187
+ attribute :last_load_date, :string
188
+ attribute :last_save_date, :string
189
189
 
190
190
  xml do
191
191
  root "times"
@@ -197,14 +197,14 @@ module Xmi
197
197
  end
198
198
  end
199
199
 
200
- class SparxElementFlags < Shale::Mapper
201
- attribute :is_controlled, Shale::Type::Integer
202
- attribute :is_protected, Shale::Type::Integer
203
- attribute :batch_save, Shale::Type::Integer
204
- attribute :batch_load, Shale::Type::Integer
205
- attribute :used_td, Shale::Type::Integer
206
- attribute :log_xml, Shale::Type::Integer
207
- attribute :package_flags, Shale::Type::String
200
+ class SparxElementFlags < Lutaml::Model::Serializable
201
+ attribute :is_controlled, :integer
202
+ attribute :is_protected, :integer
203
+ attribute :batch_save, :integer
204
+ attribute :batch_load, :integer
205
+ attribute :used_td, :integer
206
+ attribute :log_xml, :integer
207
+ attribute :package_flags, :string
208
208
 
209
209
  xml do
210
210
  root "flags"
@@ -219,11 +219,11 @@ module Xmi
219
219
  end
220
220
  end
221
221
 
222
- class SparxElementAssociation < Shale::Mapper
223
- attribute :id, Shale::Type::String
224
- attribute :start, Shale::Type::String
225
- attribute :end, Shale::Type::String
226
- attribute :name, Shale::Type::String, default: -> { "Association" }
222
+ class SparxElementAssociation < Lutaml::Model::Serializable
223
+ attribute :id, :string
224
+ attribute :start, :string
225
+ attribute :end, :string
226
+ attribute :name, :string, default: -> { "Association" }
227
227
 
228
228
  xml do
229
229
  root "Association"
@@ -235,7 +235,7 @@ module Xmi
235
235
  end
236
236
 
237
237
  class SparxElementGeneralization < SparxElementAssociation
238
- attribute :name, Shale::Type::String, default: -> { "Generalization" }
238
+ attribute :name, :string, default: -> { "Generalization" }
239
239
 
240
240
  xml do
241
241
  root "Generalization"
@@ -247,7 +247,7 @@ module Xmi
247
247
  end
248
248
 
249
249
  class SparxElementAggregation < SparxElementAssociation
250
- attribute :name, Shale::Type::String, default: -> { "Aggregation" }
250
+ attribute :name, :string, default: -> { "Aggregation" }
251
251
 
252
252
  xml do
253
253
  root "Aggregation"
@@ -259,7 +259,7 @@ module Xmi
259
259
  end
260
260
 
261
261
  class SparxElementNoteLink < SparxElementAssociation
262
- attribute :name, Shale::Type::String, default: -> { "NoteLink" }
262
+ attribute :name, :string, default: -> { "NoteLink" }
263
263
 
264
264
  xml do
265
265
  root "NoteLink"
@@ -270,8 +270,8 @@ module Xmi
270
270
  end
271
271
  end
272
272
 
273
- class SparxElementStyleex < Shale::Mapper
274
- attribute :value, Shale::Type::String
273
+ class SparxElementStyleex < Lutaml::Model::Serializable
274
+ attribute :value, :string
275
275
 
276
276
  xml do
277
277
  root "styleex"
@@ -280,9 +280,9 @@ module Xmi
280
280
  end
281
281
  end
282
282
 
283
- class SparxElementBounds < Shale::Mapper
284
- attribute :lower, Shale::Type::Integer
285
- attribute :upper, Shale::Type::Integer
283
+ class SparxElementBounds < Lutaml::Model::Serializable
284
+ attribute :lower, :integer
285
+ attribute :upper, :integer
286
286
 
287
287
  xml do
288
288
  root "bounds"
@@ -292,8 +292,8 @@ module Xmi
292
292
  end
293
293
  end
294
294
 
295
- class SparxElementStereotype < Shale::Mapper
296
- attribute :stereotype, Shale::Type::String
295
+ class SparxElementStereotype < Lutaml::Model::Serializable
296
+ attribute :stereotype, :string
297
297
 
298
298
  xml do
299
299
  root "stereotype"
@@ -302,9 +302,9 @@ module Xmi
302
302
  end
303
303
  end
304
304
 
305
- class SparxElementContainment < Shale::Mapper
306
- attribute :containment, Shale::Type::String
307
- attribute :position, Shale::Type::Integer
305
+ class SparxElementContainment < Lutaml::Model::Serializable
306
+ attribute :containment, :string
307
+ attribute :position, :integer
308
308
 
309
309
  xml do
310
310
  root "containment"
@@ -314,9 +314,9 @@ module Xmi
314
314
  end
315
315
  end
316
316
 
317
- class SparxElementCoords < Shale::Mapper
318
- attribute :ordered, Shale::Type::Integer
319
- attribute :scale, Shale::Type::Integer
317
+ class SparxElementCoords < Lutaml::Model::Serializable
318
+ attribute :ordered, :integer
319
+ attribute :scale, :integer
320
320
 
321
321
  xml do
322
322
  root "coords"
@@ -326,15 +326,15 @@ module Xmi
326
326
  end
327
327
  end
328
328
 
329
- class SparxElementAttribute < Shale::Mapper
330
- attribute :idref, Shale::Type::String
331
- attribute :name, Shale::Type::String
332
- attribute :scope, Shale::Type::String
333
- attribute :initial, Shale::Type::String
329
+ class SparxElementAttribute < Lutaml::Model::Serializable
330
+ attribute :idref, :string
331
+ attribute :name, :string
332
+ attribute :scope, :string
333
+ attribute :initial, :string
334
334
  attribute :documentation, SparxElementDocumentation
335
- attribute :options, Shale::Type::String
336
- attribute :style, Shale::Type::String
337
- attribute :tags, Shale::Type::String, collection: true
335
+ attribute :options, :string
336
+ attribute :style, :string
337
+ attribute :tags, :string, collection: true
338
338
  attribute :model, SparxElementModel
339
339
  attribute :properties, SparxElementProperties
340
340
  attribute :coords, SparxElementCoords
@@ -351,33 +351,33 @@ module Xmi
351
351
  map_attribute "name", to: :name
352
352
  map_attribute "scope", to: :scope
353
353
 
354
- map_element "initial", to: :initial
355
- map_element "options", to: :options
356
- map_element "style", to: :style
357
- map_element "tags", to: :tags
358
- map_element "documentation", to: :documentation
359
- map_element "model", to: :model
360
- map_element "properties", to: :properties
361
- map_element "coords", to: :coords
362
- map_element "containment", to: :containment
363
- map_element "stereotype", to: :stereotype
364
- map_element "bounds", to: :bounds
365
- map_element "styleex", to: :styleex
366
- map_element "xrefs", to: :xrefs
354
+ map_element "initial", to: :initial, namespace: nil, prefix: nil
355
+ map_element "options", to: :options, namespace: nil, prefix: nil
356
+ map_element "style", to: :style, namespace: nil, prefix: nil
357
+ map_element "tags", to: :tags, namespace: nil, prefix: nil
358
+ map_element "documentation", to: :documentation, namespace: nil, prefix: nil
359
+ map_element "model", to: :model, namespace: nil, prefix: nil
360
+ map_element "properties", to: :properties, namespace: nil, prefix: nil
361
+ map_element "coords", to: :coords, namespace: nil, prefix: nil
362
+ map_element "containment", to: :containment, namespace: nil, prefix: nil
363
+ map_element "stereotype", to: :stereotype, namespace: nil, prefix: nil
364
+ map_element "bounds", to: :bounds, namespace: nil, prefix: nil
365
+ map_element "styleex", to: :styleex, namespace: nil, prefix: nil
366
+ map_element "xrefs", to: :xrefs, namespace: nil, prefix: nil
367
367
  end
368
368
  end
369
369
 
370
- class SparxElementAttributes < Shale::Mapper
370
+ class SparxElementAttributes < Lutaml::Model::Serializable
371
371
  attribute :attribute, SparxElementAttribute, collection: true
372
372
 
373
373
  xml do
374
374
  root "attributes"
375
375
 
376
- map_element "attribute", to: :attribute
376
+ map_element "attribute", to: :attribute, namespace: nil, prefix: nil
377
377
  end
378
378
  end
379
379
 
380
- class SparxElementLinks < Shale::Mapper
380
+ class SparxElementLinks < Lutaml::Model::Serializable
381
381
  attribute :association, SparxElementAssociation, collection: true
382
382
  attribute :generalization, SparxElementGeneralization, collection: true
383
383
  attribute :note_link, SparxElementNoteLink, collection: true
@@ -385,17 +385,17 @@ module Xmi
385
385
  xml do
386
386
  root "links"
387
387
 
388
- map_element "Association", to: :association
389
- map_element "Generalization", to: :generalization
390
- map_element "NoteLink", to: :note_link
388
+ map_element "Association", to: :association, namespace: nil, prefix: nil
389
+ map_element "Generalization", to: :generalization, namespace: nil, prefix: nil
390
+ map_element "NoteLink", to: :note_link, namespace: nil, prefix: nil
391
391
  end
392
392
  end
393
393
 
394
- class SparxElement < Shale::Mapper
395
- attribute :idref, Shale::Type::String
396
- attribute :type, Shale::Type::String
397
- attribute :name, Shale::Type::String
398
- attribute :scope, Shale::Type::String
394
+ class SparxElement < Lutaml::Model::Serializable
395
+ attribute :idref, :string
396
+ attribute :type, :string
397
+ attribute :name, :string
398
+ attribute :scope, :string
399
399
  attribute :model, SparxElementModel
400
400
  attribute :properties, SparxElementProperties
401
401
  attribute :project, SparxElementProject
@@ -419,37 +419,37 @@ module Xmi
419
419
  map_attribute "name", to: :name
420
420
  map_attribute "scope", to: :scope
421
421
 
422
- map_element "model", to: :model
423
- map_element "properties", to: :properties
424
- map_element "project", to: :project
425
- map_element "code", to: :code
426
- map_element "style", to: :style
427
- map_element "tags", to: :tags
428
- map_element "xrefs", to: :xrefs
422
+ map_element "model", to: :model, namespace: nil, prefix: nil
423
+ map_element "properties", to: :properties, namespace: nil, prefix: nil
424
+ map_element "project", to: :project, namespace: nil, prefix: nil
425
+ map_element "code", to: :code, namespace: nil, prefix: nil
426
+ map_element "style", to: :style, namespace: nil, prefix: nil
427
+ map_element "tags", to: :tags, namespace: nil, prefix: nil
428
+ map_element "xrefs", to: :xrefs, namespace: nil, prefix: nil
429
429
  map_element "extendedProperties", to: :extended_properties, namespace: nil, prefix: nil
430
- map_element "packageproperties", to: :package_properties
431
- map_element "paths", to: :paths
432
- map_element "times", to: :times
433
- map_element "flags", to: :flags
434
- map_element "links", to: :links
435
- map_element "attributes", to: :attributes
430
+ map_element "packageproperties", to: :package_properties, namespace: nil, prefix: nil
431
+ map_element "paths", to: :paths, namespace: nil, prefix: nil
432
+ map_element "times", to: :times, namespace: nil, prefix: nil
433
+ map_element "flags", to: :flags, namespace: nil, prefix: nil
434
+ map_element "links", to: :links, namespace: nil, prefix: nil
435
+ map_element "attributes", to: :attributes, namespace: nil, prefix: nil
436
436
  end
437
437
  end
438
438
 
439
- class SparxElements < Shale::Mapper
439
+ class SparxElements < Lutaml::Model::Serializable
440
440
  attribute :element, SparxElement, collection: true
441
441
 
442
442
  xml do
443
443
  root "elements"
444
444
 
445
- map_element "element", to: :element
445
+ map_element "element", to: :element, namespace: nil, prefix: nil
446
446
  end
447
447
  end
448
448
 
449
- class SparxConnectorModel < Shale::Mapper
450
- attribute :ea_localid, Shale::Type::String
451
- attribute :type, Shale::Type::String
452
- attribute :name, Shale::Type::String
449
+ class SparxConnectorModel < Lutaml::Model::Serializable
450
+ attribute :ea_localid, :string
451
+ attribute :type, :string
452
+ attribute :name, :string
453
453
 
454
454
  xml do
455
455
  map_attribute "ea_localid", to: :ea_localid
@@ -458,10 +458,10 @@ module Xmi
458
458
  end
459
459
  end
460
460
 
461
- class SparxConnectorEndRole < Shale::Mapper
462
- attribute :name, Shale::Type::String
463
- attribute :visibility, Shale::Type::String
464
- attribute :target_scope, Shale::Type::String
461
+ class SparxConnectorEndRole < Lutaml::Model::Serializable
462
+ attribute :name, :string
463
+ attribute :visibility, :string
464
+ attribute :target_scope, :string
465
465
 
466
466
  xml do
467
467
  root "role"
@@ -472,10 +472,10 @@ module Xmi
472
472
  end
473
473
  end
474
474
 
475
- class SparxConnectorEndType < Shale::Mapper
476
- attribute :aggregation, Shale::Type::String
477
- attribute :multiplicity, Shale::Type::String
478
- attribute :containment, Shale::Type::String
475
+ class SparxConnectorEndType < Lutaml::Model::Serializable
476
+ attribute :aggregation, :string
477
+ attribute :multiplicity, :string
478
+ attribute :containment, :string
479
479
 
480
480
  xml do
481
481
  root "type"
@@ -486,9 +486,9 @@ module Xmi
486
486
  end
487
487
  end
488
488
 
489
- class SparxConnectorEndModifiers < Shale::Mapper
490
- attribute :is_ordered, Shale::Type::Boolean
491
- attribute :is_navigable, Shale::Type::Boolean
489
+ class SparxConnectorEndModifiers < Lutaml::Model::Serializable
490
+ attribute :is_ordered, :boolean
491
+ attribute :is_navigable, :boolean
492
492
 
493
493
  xml do
494
494
  root "type"
@@ -498,11 +498,11 @@ module Xmi
498
498
  end
499
499
  end
500
500
 
501
- class SparxConnectorEndConstraint < Shale::Mapper
502
- attribute :name, Shale::Type::String
503
- attribute :type, Shale::Type::String
504
- attribute :weight, Shale::Type::Float
505
- attribute :status, Shale::Type::String
501
+ class SparxConnectorEndConstraint < Lutaml::Model::Serializable
502
+ attribute :name, :string
503
+ attribute :type, :string
504
+ attribute :weight, :float
505
+ attribute :status, :string
506
506
 
507
507
  xml do
508
508
  root "constraint"
@@ -514,17 +514,17 @@ module Xmi
514
514
  end
515
515
  end
516
516
 
517
- class SparxConnectorEndConstraints < Shale::Mapper
517
+ class SparxConnectorEndConstraints < Lutaml::Model::Serializable
518
518
  attribute :constraint, SparxConnectorEndConstraint, collection: true
519
519
  xml do
520
520
  root "constraints"
521
521
 
522
- map_element "constraint", to: :constraint
522
+ map_element "constraint", to: :constraint, namespace: nil, prefix: nil
523
523
  end
524
524
  end
525
525
 
526
- class SparxConnectorEndStyle < Shale::Mapper
527
- attribute :value, Shale::Type::String
526
+ class SparxConnectorEndStyle < Lutaml::Model::Serializable
527
+ attribute :value, :string
528
528
 
529
529
  xml do
530
530
  root "style"
@@ -536,21 +536,21 @@ module Xmi
536
536
  module SparxConnectorEnd
537
537
  def self.included(klass) # rubocop:disable Metrics/MethodLength
538
538
  klass.class_eval do
539
- attribute :idref, Shale::Type::String
539
+ attribute :idref, :string
540
540
  attribute :model, SparxConnectorModel
541
541
  attribute :role, SparxConnectorEndRole
542
542
  attribute :type, SparxConnectorEndType
543
543
  attribute :constraints, SparxConnectorEndConstraints
544
544
  attribute :modifiers, SparxConnectorEndModifiers
545
545
  attribute :style, SparxConnectorEndStyle
546
- attribute :documentation, Shale::Type::String
546
+ attribute :documentation, :string
547
547
  attribute :xrefs, SparxElementXrefs
548
548
  attribute :tags, SparxElementTags
549
549
  end
550
550
  end
551
551
  end
552
552
 
553
- class SparxConnectorSource < Shale::Mapper
553
+ class SparxConnectorSource < Lutaml::Model::Serializable
554
554
  include SparxConnectorEnd
555
555
 
556
556
  xml do
@@ -558,19 +558,19 @@ module Xmi
558
558
 
559
559
  map_attribute "idref", to: :idref, prefix: "xmi", namespace: "http://www.omg.org/spec/XMI/20131001"
560
560
 
561
- map_element "model", to: :model, render_nil: true
562
- map_element "role", to: :role, render_nil: true
563
- map_element "type", to: :type, render_nil: true
564
- map_element "constraints", to: :constraints, render_nil: true
565
- map_element "modifiers", to: :modifiers, render_nil: true
566
- map_element "style", to: :style, render_nil: true
567
- map_element "documentation", to: :documentation, render_nil: true
568
- map_element "xrefs", to: :xrefs, render_nil: true
569
- map_element "tags", to: :tags, render_nil: true
561
+ map_element "model", to: :model, render_nil: true, namespace: nil, prefix: nil
562
+ map_element "role", to: :role, render_nil: true, namespace: nil, prefix: nil
563
+ map_element "type", to: :type, render_nil: true, namespace: nil, prefix: nil
564
+ map_element "constraints", to: :constraints, render_nil: true, namespace: nil, prefix: nil
565
+ map_element "modifiers", to: :modifiers, render_nil: true, namespace: nil, prefix: nil
566
+ map_element "style", to: :style, render_nil: true, namespace: nil, prefix: nil
567
+ map_element "documentation", to: :documentation, render_nil: true, namespace: nil, prefix: nil
568
+ map_element "xrefs", to: :xrefs, render_nil: true, namespace: nil, prefix: nil
569
+ map_element "tags", to: :tags, render_nil: true, namespace: nil, prefix: nil
570
570
  end
571
571
  end
572
572
 
573
- class SparxConnectorTarget < Shale::Mapper
573
+ class SparxConnectorTarget < Lutaml::Model::Serializable
574
574
  include SparxConnectorEnd
575
575
 
576
576
  xml do
@@ -578,21 +578,21 @@ module Xmi
578
578
 
579
579
  map_attribute "idref", to: :idref, prefix: "xmi", namespace: "http://www.omg.org/spec/XMI/20131001"
580
580
 
581
- map_element "model", to: :model, render_nil: true
582
- map_element "role", to: :role, render_nil: true
583
- map_element "type", to: :type, render_nil: true
584
- map_element "constraints", to: :constraints, render_nil: true
585
- map_element "modifiers", to: :modifiers, render_nil: true
586
- map_element "style", to: :style, render_nil: true
587
- map_element "documentation", to: :documentation, render_nil: true
588
- map_element "xrefs", to: :xrefs, render_nil: true
589
- map_element "tags", to: :tags, render_nil: true
581
+ map_element "model", to: :model, render_nil: true, namespace: nil, prefix: nil
582
+ map_element "role", to: :role, render_nil: true, namespace: nil, prefix: nil
583
+ map_element "type", to: :type, render_nil: true, namespace: nil, prefix: nil
584
+ map_element "constraints", to: :constraints, render_nil: true, namespace: nil, prefix: nil
585
+ map_element "modifiers", to: :modifiers, render_nil: true, namespace: nil, prefix: nil
586
+ map_element "style", to: :style, render_nil: true, namespace: nil, prefix: nil
587
+ map_element "documentation", to: :documentation, render_nil: true, namespace: nil, prefix: nil
588
+ map_element "xrefs", to: :xrefs, render_nil: true, namespace: nil, prefix: nil
589
+ map_element "tags", to: :tags, render_nil: true, namespace: nil, prefix: nil
590
590
  end
591
591
  end
592
592
 
593
- class SparxConnectorProperties < Shale::Mapper
594
- attribute :ea_type, Shale::Type::String
595
- attribute :direction, Shale::Type::String
593
+ class SparxConnectorProperties < Lutaml::Model::Serializable
594
+ attribute :ea_type, :string
595
+ attribute :direction, :string
596
596
 
597
597
  xml do
598
598
  root "properties"
@@ -602,13 +602,13 @@ module Xmi
602
602
  end
603
603
  end
604
604
 
605
- class SparxConnectorAppearance < Shale::Mapper
606
- attribute :linemode, Shale::Type::Integer
607
- attribute :linecolor, Shale::Type::Integer
608
- attribute :linewidth, Shale::Type::Integer
609
- attribute :seqno, Shale::Type::Integer
610
- attribute :headStyle, Shale::Type::Integer
611
- attribute :lineStyle, Shale::Type::Integer
605
+ class SparxConnectorAppearance < Lutaml::Model::Serializable
606
+ attribute :linemode, :integer
607
+ attribute :linecolor, :integer
608
+ attribute :linewidth, :integer
609
+ attribute :seqno, :integer
610
+ attribute :headStyle, :integer
611
+ attribute :lineStyle, :integer
612
612
 
613
613
  xml do
614
614
  root "appearance"
@@ -622,13 +622,13 @@ module Xmi
622
622
  end
623
623
  end
624
624
 
625
- class SparxConnectorLabels < Shale::Mapper
626
- attribute :rb, Shale::Type::String
627
- attribute :lb, Shale::Type::String
628
- attribute :mb, Shale::Type::String
629
- attribute :rt, Shale::Type::String
630
- attribute :lt, Shale::Type::String
631
- attribute :mt, Shale::Type::String
625
+ class SparxConnectorLabels < Lutaml::Model::Serializable
626
+ attribute :rb, :string
627
+ attribute :lb, :string
628
+ attribute :mb, :string
629
+ attribute :rt, :string
630
+ attribute :lt, :string
631
+ attribute :mt, :string
632
632
 
633
633
  xml do
634
634
  root "labels"
@@ -642,8 +642,8 @@ module Xmi
642
642
  end
643
643
  end
644
644
 
645
- class SparxConnector < Shale::Mapper
646
- attribute :idref, Shale::Type::String
645
+ class SparxConnector < Lutaml::Model::Serializable
646
+ attribute :idref, :string
647
647
  attribute :source, SparxConnectorSource
648
648
  attribute :target, SparxConnectorTarget
649
649
  attribute :model, SparxConnectorModel
@@ -661,40 +661,40 @@ module Xmi
661
661
 
662
662
  map_attribute "idref", to: :idref, prefix: "xmi", namespace: "http://www.omg.org/spec/XMI/20131001"
663
663
 
664
- map_element "source", to: :source
665
- map_element "target", to: :target
666
- map_element "model", to: :model
667
- map_element "properties", to: :properties
668
- map_element "documentation", to: :documentation, render_nil: true
669
- map_element "appearance", to: :appearance
670
- map_element "labels", to: :labels, render_nil: true
671
- map_element "extendedProperties", to: :extended_properties
672
- map_element "style", to: :style, render_nil: true
673
- map_element "xrefs", to: :xrefs, render_nil: true
674
- map_element "tags", to: :tags, render_nil: true
664
+ map_element "source", to: :source, namespace: nil, prefix: nil
665
+ map_element "target", to: :target, namespace: nil, prefix: nil
666
+ map_element "model", to: :model, namespace: nil, prefix: nil
667
+ map_element "properties", to: :properties, namespace: nil, prefix: nil
668
+ map_element "documentation", to: :documentation, render_nil: true, namespace: nil, prefix: nil
669
+ map_element "appearance", to: :appearance, namespace: nil, prefix: nil
670
+ map_element "labels", to: :labels, render_nil: true, namespace: nil, prefix: nil
671
+ map_element "extendedProperties", to: :extended_properties, namespace: nil, prefix: nil
672
+ map_element "style", to: :style, render_nil: true, namespace: nil, prefix: nil
673
+ map_element "xrefs", to: :xrefs, render_nil: true, namespace: nil, prefix: nil
674
+ map_element "tags", to: :tags, render_nil: true, namespace: nil, prefix: nil
675
675
  end
676
676
  end
677
677
 
678
- class SparxConnectors < Shale::Mapper
678
+ class SparxConnectors < Lutaml::Model::Serializable
679
679
  attribute :connector, SparxConnector, collection: true
680
680
  xml do
681
681
  root "connectors"
682
682
 
683
- map_element "connector", to: :connector
683
+ map_element "connector", to: :connector, namespace: nil, prefix: nil
684
684
  end
685
685
  end
686
686
 
687
- class SparxPrimitiveTypes < Shale::Mapper
687
+ class SparxPrimitiveTypes < Lutaml::Model::Serializable
688
688
  attribute :packaged_element, Uml::PackagedElement, collection: true
689
689
 
690
690
  xml do
691
691
  root "primitivetypes"
692
692
 
693
- map_element "packagedElement", to: :packaged_element
693
+ map_element "packagedElement", to: :packaged_element, namespace: nil, prefix: nil
694
694
  end
695
695
  end
696
696
 
697
- class SparxProfiles < Shale::Mapper
697
+ class SparxProfiles < Lutaml::Model::Serializable
698
698
  attribute :profile, Uml::Profile, collection: true
699
699
 
700
700
  xml do
@@ -706,11 +706,11 @@ module Xmi
706
706
  end
707
707
  end
708
708
 
709
- class SparxDiagramElement < Shale::Mapper
710
- attribute :geometry, Shale::Type::String
711
- attribute :subject, Shale::Type::String
712
- attribute :seqno, Shale::Type::Integer
713
- attribute :style, Shale::Type::String
709
+ class SparxDiagramElement < Lutaml::Model::Serializable
710
+ attribute :geometry, :string
711
+ attribute :subject, :string
712
+ attribute :seqno, :integer
713
+ attribute :style, :string
714
714
 
715
715
  xml do
716
716
  root "element"
@@ -722,19 +722,19 @@ module Xmi
722
722
  end
723
723
  end
724
724
 
725
- class SparxDiagramElements < Shale::Mapper
725
+ class SparxDiagramElements < Lutaml::Model::Serializable
726
726
  attribute :element, SparxDiagramElement, collection: true
727
727
  xml do
728
728
  root "elements"
729
729
 
730
- map_element "element", to: :element
730
+ map_element "element", to: :element, namespace: nil, prefix: nil
731
731
  end
732
732
  end
733
733
 
734
- class SparxDiagramModel < Shale::Mapper
735
- attribute :package, Shale::Type::String
736
- attribute :local_id, Shale::Type::String
737
- attribute :owner, Shale::Type::String
734
+ class SparxDiagramModel < Lutaml::Model::Serializable
735
+ attribute :package, :string
736
+ attribute :local_id, :string
737
+ attribute :owner, :string
738
738
 
739
739
  xml do
740
740
  root "model"
@@ -745,7 +745,7 @@ module Xmi
745
745
  end
746
746
  end
747
747
 
748
- class SparxDiagramStyle < Shale::Mapper
748
+ class SparxDiagramStyle < Lutaml::Model::Serializable
749
749
  attribute :value, SparxDiagramElement
750
750
 
751
751
  xml do
@@ -753,8 +753,8 @@ module Xmi
753
753
  end
754
754
  end
755
755
 
756
- class SparxDiagram < Shale::Mapper
757
- attribute :id, Shale::Type::String
756
+ class SparxDiagram < Lutaml::Model::Serializable
757
+ attribute :id, :string
758
758
  attribute :model, SparxDiagramModel
759
759
  attribute :properties, SparxElementProperties
760
760
  attribute :project, SparxElementProject
@@ -771,54 +771,54 @@ module Xmi
771
771
 
772
772
  map_attribute "id", to: :id, prefix: "xmi", namespace: "http://www.omg.org/spec/XMI/20131001"
773
773
 
774
- map_element "model", to: :model
775
- map_element "properties", to: :properties
776
- map_element "project", to: :project
777
- map_element "style1", to: :style1, render_nil: true
778
- map_element "style2", to: :style2, render_nil: true
779
- map_element "swimlanes", to: :swimlanes, render_nil: true
780
- map_element "matrixitems", to: :matrixitems, render_nil: true
781
- map_element "extendedProperties", to: :extended_properties, render_nil: true
782
- map_element "xrefs", to: :xrefs, render_nil: true
783
- map_element "elements", to: :elements
774
+ map_element "model", to: :model, namespace: nil, prefix: nil
775
+ map_element "properties", to: :properties, namespace: nil, prefix: nil
776
+ map_element "project", to: :project, namespace: nil, prefix: nil
777
+ map_element "style1", to: :style1, render_nil: true, namespace: nil, prefix: nil
778
+ map_element "style2", to: :style2, render_nil: true, namespace: nil, prefix: nil
779
+ map_element "swimlanes", to: :swimlanes, render_nil: true, namespace: nil, prefix: nil
780
+ map_element "matrixitems", to: :matrixitems, render_nil: true, namespace: nil, prefix: nil
781
+ map_element "extendedProperties", to: :extended_properties, render_nil: true, namespace: nil, prefix: nil
782
+ map_element "xrefs", to: :xrefs, render_nil: true, namespace: nil, prefix: nil
783
+ map_element "elements", to: :elements, namespace: nil, prefix: nil
784
784
  end
785
785
  end
786
786
 
787
- class SparxDiagrams < Shale::Mapper
787
+ class SparxDiagrams < Lutaml::Model::Serializable
788
788
  attribute :diagram, SparxDiagram, collection: true
789
789
 
790
790
  xml do
791
791
  root "diagrams"
792
792
 
793
- map_element "diagram", to: :diagram
793
+ map_element "diagram", to: :diagram, namespace: nil, prefix: nil
794
794
  end
795
795
  end
796
796
 
797
- class SparxEAStub < Shale::Mapper
798
- attribute :id, Shale::Type::String
799
- attribute :name, Shale::Type::String
800
- attribute :uml_type, Shale::Type::String
797
+ class SparxEAStub < Lutaml::Model::Serializable
798
+ attribute :id, :string
799
+ attribute :name, :string
800
+ attribute :uml_type, :string
801
801
 
802
802
  xml do
803
- root "diagrams"
803
+ root "EAStub"
804
804
 
805
805
  map_attribute "id", to: :id, prefix: "xmi", namespace: "http://www.omg.org/spec/XMI/20131001"
806
- map_attribute "name", to: :name
807
- map_attribute "UMLType", to: :uml_type
806
+ map_attribute "name", to: :name, namespace: nil, prefix: nil
807
+ map_attribute "UMLType", to: :uml_type, namespace: nil, prefix: nil
808
808
  end
809
809
  end
810
810
 
811
811
  module SparxExtensionAttributes
812
812
  def self.included(klass) # rubocop:disable Metrics/MethodLength
813
813
  klass.class_eval do
814
- attribute :id, Shale::Type::String
815
- attribute :label, Shale::Type::String
816
- attribute :uuid, Shale::Type::String
817
- attribute :href, Shale::Type::String
818
- attribute :idref, Shale::Type::String
819
- attribute :type, Shale::Type::String
820
- attribute :extender, Shale::Type::String
821
- attribute :extender_id, Shale::Type::String
814
+ attribute :id, :string
815
+ attribute :label, :string
816
+ attribute :uuid, :string
817
+ attribute :href, :string
818
+ attribute :idref, :string
819
+ attribute :type, :string
820
+ attribute :extender, :string
821
+ attribute :extender_id, :string
822
822
  attribute :elements, SparxElements
823
823
  attribute :connectors, SparxConnectors
824
824
  attribute :primitive_types, SparxPrimitiveTypes
@@ -828,7 +828,7 @@ module Xmi
828
828
  end
829
829
  end
830
830
 
831
- class SparxExtension < Shale::Mapper
831
+ class SparxExtension < Lutaml::Model::Serializable
832
832
  include SparxExtensionAttributes
833
833
  attribute :profiles, SparxProfiles
834
834
 
@@ -844,18 +844,18 @@ module Xmi
844
844
  map_attribute "extender", to: :extender
845
845
  map_attribute "extenderID", to: :extender_id
846
846
 
847
- map_element "elements", to: :elements
848
- map_element "connectors", to: :connectors
849
- map_element "primitivetypes", to: :primitive_types
850
- map_element "profiles", to: :profiles
851
- map_element "diagrams", to: :diagrams
852
- map_element "EAStub", to: :ea_stub
847
+ map_element "elements", to: :elements, namespace: nil, prefix: nil
848
+ map_element "connectors", to: :connectors, namespace: nil, prefix: nil
849
+ map_element "primitivetypes", to: :primitive_types, namespace: nil, prefix: nil
850
+ map_element "profiles", to: :profiles, namespace: nil, prefix: nil
851
+ map_element "diagrams", to: :diagrams, namespace: nil, prefix: nil
852
+ map_element "EAStub", to: :ea_stub, namespace: nil, prefix: nil
853
853
  end
854
854
  end
855
855
 
856
- class SparxSysPhS < Shale::Mapper
857
- attribute :base_package, Shale::Type::String
858
- attribute :name, Shale::Type::String
856
+ class SparxSysPhS < Lutaml::Model::Serializable
857
+ attribute :base_package, :string
858
+ attribute :name, :string
859
859
 
860
860
  xml do
861
861
  root "ModelicaParameter"
@@ -866,9 +866,9 @@ module Xmi
866
866
  end
867
867
  end
868
868
 
869
- class SparxCustomProfilePublicationDate < Shale::Mapper
870
- attribute :base_package, Shale::Type::String
871
- attribute :publication_date, Shale::Type::String
869
+ class SparxCustomProfilePublicationDate < Lutaml::Model::Serializable
870
+ attribute :base_package, :string
871
+ attribute :publication_date, :string
872
872
 
873
873
  xml do
874
874
  root "publicationDate"
@@ -879,9 +879,9 @@ module Xmi
879
879
  end
880
880
  end
881
881
 
882
- class SparxCustomProfileEdition < Shale::Mapper
883
- attribute :base_package, Shale::Type::String
884
- attribute :edition, Shale::Type::String
882
+ class SparxCustomProfileEdition < Lutaml::Model::Serializable
883
+ attribute :base_package, :string
884
+ attribute :edition, :string
885
885
 
886
886
  xml do
887
887
  root "edition"
@@ -892,9 +892,9 @@ module Xmi
892
892
  end
893
893
  end
894
894
 
895
- class SparxCustomProfileNumber < Shale::Mapper
896
- attribute :base_package, Shale::Type::String
897
- attribute :number, Shale::Type::String
895
+ class SparxCustomProfileNumber < Lutaml::Model::Serializable
896
+ attribute :base_package, :string
897
+ attribute :number, :string
898
898
 
899
899
  xml do
900
900
  root "number"
@@ -905,9 +905,9 @@ module Xmi
905
905
  end
906
906
  end
907
907
 
908
- class SparxCustomProfileYearVersion < Shale::Mapper
909
- attribute :base_package, Shale::Type::String
910
- attribute :year_version, Shale::Type::String
908
+ class SparxCustomProfileYearVersion < Lutaml::Model::Serializable
909
+ attribute :base_package, :string
910
+ attribute :year_version, :string
911
911
 
912
912
  xml do
913
913
  root "yearVersion"
@@ -940,15 +940,17 @@ module Xmi
940
940
  end
941
941
  end
942
942
 
943
- class SparxRoot < Root
943
+ class SparxRoot < Root # rubocop:disable Metrics/ClassLength
944
944
  include SparxRootAttributes
945
945
  attribute :extension, SparxExtension
946
+ attribute :model, Uml::UmlModel
946
947
 
947
948
  class << self
948
949
  def parse_xml(xml_content)
949
950
  xml_content = fix_encoding(xml_content)
950
951
  xml_content = replace_xmlns(xml_content)
951
952
  xml_content = replace_relative_ns(xml_content)
953
+ xml_content = replace_ea_xmlns(xml_content)
952
954
 
953
955
  from_xml(xml_content)
954
956
  end
@@ -981,20 +983,27 @@ module Xmi
981
983
  '<\1xmlns="\3" targetNamespace="\3"\4>'
982
984
  )
983
985
  end
986
+
987
+ def replace_ea_xmlns(xml_content)
988
+ xml_content
989
+ .gsub(
990
+ /<GML:ApplicationSchema(.*)xmlns="(.*)"(.*)>/,
991
+ '<GML:ApplicationSchema\1altered_xmlns="\2"\3>'
992
+ )
993
+ .gsub(
994
+ /<CityGML:ApplicationSchema(.*)xmlns="(.*)"(.*)>/,
995
+ '<CityGML:ApplicationSchema\1altered_xmlns="\2"\3>'
996
+ )
997
+ end
984
998
  end
985
999
 
986
1000
  @@default_mapping = <<-MAP # rubocop:disable Style/ClassVars
987
1001
  root "XMI"
988
1002
  namespace "http://www.omg.org/spec/XMI/20131001", "xmi"
989
1003
 
990
- map_attribute "id", to: :id
991
- map_attribute "label", to: :label
992
- map_attribute "uuid", to: :uuid
993
- map_attribute "href", to: :href
994
- map_attribute "idref", to: :idref
995
- map_attribute "type", to: :type
996
-
997
- map_element "Extension", to: :extension
1004
+ map_element "Extension", to: :extension,
1005
+ namespace: "http://www.omg.org/spec/XMI/20131001",
1006
+ prefix: "xmi"
998
1007
  map_element "publicationDate", to: :publication_date,
999
1008
  namespace: "http://www.sparxsystems.com/profiles/thecustomprofile/1.0",
1000
1009
  prefix: "thecustomprofile"
@@ -1037,6 +1046,10 @@ module Xmi
1037
1046
  map_element "property", to: :gml_property,
1038
1047
  namespace: "http://www.sparxsystems.com/profiles/GML/1.0",
1039
1048
  prefix: "GML"
1049
+
1050
+ map_element "Model", to: :model,
1051
+ namespace: "http://www.omg.org/spec/UML/20131001",
1052
+ prefix: "uml"
1040
1053
  MAP
1041
1054
 
1042
1055
  @@mapping ||= @@default_mapping # rubocop:disable Style/ClassVars