xmi 0.5.2 → 0.5.4
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/rake.yml +5 -1
- data/.rubocop_todo.yml +52 -9
- data/lib/xmi/extension.rb +4 -12
- data/lib/xmi/parser_pipeline.rb +70 -0
- data/lib/xmi/root.rb +3 -12
- data/lib/xmi/sparx/connector/appearance.rb +27 -0
- data/lib/xmi/sparx/connector/connector.rb +52 -0
- data/lib/xmi/sparx/connector/end_base.rb +56 -0
- data/lib/xmi/sparx/connector/end_constraint.rb +33 -0
- data/lib/xmi/sparx/connector/end_modifiers.rb +19 -0
- data/lib/xmi/sparx/connector/end_role.rb +21 -0
- data/lib/xmi/sparx/connector/end_style.rb +17 -0
- data/lib/xmi/sparx/connector/end_type.rb +21 -0
- data/lib/xmi/sparx/connector/labels.rb +27 -0
- data/lib/xmi/sparx/connector/model.rb +19 -0
- data/lib/xmi/sparx/connector/properties.rb +19 -0
- data/lib/xmi/sparx/connector.rb +15 -233
- data/lib/xmi/sparx/element/association.rb +58 -0
- data/lib/xmi/sparx/element/attribute.rb +58 -0
- data/lib/xmi/sparx/element/bounds.rb +19 -0
- data/lib/xmi/sparx/element/code.rb +19 -0
- data/lib/xmi/sparx/element/containment.rb +19 -0
- data/lib/xmi/sparx/element/coords.rb +19 -0
- data/lib/xmi/sparx/element/documentation.rb +17 -0
- data/lib/xmi/sparx/element/element.rb +62 -0
- data/lib/xmi/sparx/element/extended_properties.rb +21 -0
- data/lib/xmi/sparx/element/flags.rb +29 -0
- data/lib/xmi/sparx/element/links.rb +22 -0
- data/lib/xmi/sparx/element/model.rb +26 -0
- data/lib/xmi/sparx/element/package_properties.rb +21 -0
- data/lib/xmi/sparx/element/paths.rb +17 -0
- data/lib/xmi/sparx/element/project.rb +29 -0
- data/lib/xmi/sparx/element/properties.rb +41 -0
- data/lib/xmi/sparx/element/stereotype.rb +17 -0
- data/lib/xmi/sparx/element/style.rb +17 -0
- data/lib/xmi/sparx/element/styleex.rb +17 -0
- data/lib/xmi/sparx/element/tag.rb +32 -0
- data/lib/xmi/sparx/element/times.rb +23 -0
- data/lib/xmi/sparx/element/xrefs.rb +17 -0
- data/lib/xmi/sparx/element.rb +28 -445
- data/lib/xmi/sparx/extension.rb +4 -12
- data/lib/xmi/sparx/gml/application_schema.rb +26 -0
- data/lib/xmi/sparx/gml/code_list.rb +23 -0
- data/lib/xmi/sparx/gml/data_type.rb +18 -0
- data/lib/xmi/sparx/gml/enumeration.rb +18 -0
- data/lib/xmi/sparx/gml/feature_type.rb +21 -0
- data/lib/xmi/sparx/gml/property.rb +24 -0
- data/lib/xmi/sparx/gml/shared_attributes.rb +39 -0
- data/lib/xmi/sparx/gml/type.rb +18 -0
- data/lib/xmi/sparx/gml/union.rb +18 -0
- data/lib/xmi/sparx/gml.rb +10 -125
- data/lib/xmi/sparx/index.rb +248 -0
- data/lib/xmi/sparx/mappings/base_mapping.rb +13 -137
- data/lib/xmi/sparx/root.rb +20 -7
- data/lib/xmi/sparx.rb +1 -0
- data/lib/xmi/uml/annotated_element.rb +16 -0
- data/lib/xmi/uml/association_generalization.rb +20 -0
- data/lib/xmi/uml/bounds.rb +43 -0
- data/lib/xmi/uml/default_value.rb +42 -0
- data/lib/xmi/uml/diagram.rb +25 -0
- data/lib/xmi/uml/member_end.rb +16 -0
- data/lib/xmi/uml/owned_attribute.rb +31 -0
- data/lib/xmi/uml/owned_comment.rb +29 -0
- data/lib/xmi/uml/owned_element.rb +33 -0
- data/lib/xmi/uml/owned_end.rb +34 -0
- data/lib/xmi/uml/owned_literal.rb +23 -0
- data/lib/xmi/uml/owned_operation.rb +22 -0
- data/lib/xmi/uml/owned_parameter.rb +29 -0
- data/lib/xmi/uml/package_import.rb +30 -0
- data/lib/xmi/uml/packaged_element.rb +49 -0
- data/lib/xmi/uml/precondition.rb +22 -0
- data/lib/xmi/uml/profile.rb +43 -0
- data/lib/xmi/uml/profile_application.rb +34 -0
- data/lib/xmi/uml/specification.rb +20 -0
- data/lib/xmi/uml/type.rb +18 -0
- data/lib/xmi/uml/uml_model.rb +29 -0
- data/lib/xmi/uml.rb +27 -502
- data/lib/xmi/version.rb +1 -1
- data/lib/xmi/version_registry.rb +2 -1
- data/lib/xmi/xmi_identity.rb +46 -0
- data/lib/xmi.rb +11 -6
- metadata +68 -2
|
@@ -6,17 +6,12 @@ module Xmi
|
|
|
6
6
|
# Base XML mapping class for Sparx EA XMI documents.
|
|
7
7
|
#
|
|
8
8
|
# This reusable mapping class encapsulates all the XML element → attribute
|
|
9
|
-
# mappings for SparxRoot
|
|
9
|
+
# mappings for SparxRoot.
|
|
10
10
|
#
|
|
11
11
|
# @example Use in a model class
|
|
12
12
|
# class SparxRoot < Root
|
|
13
13
|
# xml SparxMappings::BaseMapping
|
|
14
14
|
# end
|
|
15
|
-
#
|
|
16
|
-
# @example Extend with additional mappings
|
|
17
|
-
# class ExtendedRoot < Root
|
|
18
|
-
# xml SparxMappings::GmlMapping
|
|
19
|
-
# end
|
|
20
15
|
class BaseMapping < Lutaml::Xml::Mapping
|
|
21
16
|
xml do
|
|
22
17
|
# Set the default namespace for element name resolution
|
|
@@ -35,6 +30,8 @@ module Xmi
|
|
|
35
30
|
::Xmi::Namespace::Sparx::CityGml,
|
|
36
31
|
]
|
|
37
32
|
|
|
33
|
+
VM = ::Xmi::VALUE_MAP
|
|
34
|
+
|
|
38
35
|
# Extension element containing Sparx EA-specific metadata
|
|
39
36
|
map_element "Extension", to: :extension
|
|
40
37
|
|
|
@@ -42,139 +39,18 @@ module Xmi
|
|
|
42
39
|
map_element "ModelicaParameter", to: :modelica_parameter
|
|
43
40
|
|
|
44
41
|
# UML import elements (EAUML profile)
|
|
45
|
-
map_element "import", to: :eauml_import,
|
|
46
|
-
value_map: {
|
|
47
|
-
from: {
|
|
48
|
-
nil: :empty,
|
|
49
|
-
empty: :empty,
|
|
50
|
-
omitted: :empty,
|
|
51
|
-
},
|
|
52
|
-
to: {
|
|
53
|
-
nil: :empty,
|
|
54
|
-
empty: :empty,
|
|
55
|
-
omitted: :empty,
|
|
56
|
-
},
|
|
57
|
-
}
|
|
42
|
+
map_element "import", to: :eauml_import, value_map: VM
|
|
58
43
|
|
|
59
|
-
# GML
|
|
44
|
+
# GML elements
|
|
60
45
|
map_element "ApplicationSchema", to: :gml_application_schema,
|
|
61
|
-
value_map:
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
empty: :empty,
|
|
70
|
-
omitted: :empty,
|
|
71
|
-
},
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
# GML CodeList elements
|
|
75
|
-
map_element "CodeList", to: :gml_code_list,
|
|
76
|
-
value_map: {
|
|
77
|
-
from: {
|
|
78
|
-
nil: :empty,
|
|
79
|
-
empty: :empty,
|
|
80
|
-
omitted: :empty,
|
|
81
|
-
},
|
|
82
|
-
to: {
|
|
83
|
-
nil: :empty,
|
|
84
|
-
empty: :empty,
|
|
85
|
-
omitted: :empty,
|
|
86
|
-
},
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
# GML DataType elements
|
|
90
|
-
map_element "DataType", to: :gml_data_type,
|
|
91
|
-
value_map: {
|
|
92
|
-
from: {
|
|
93
|
-
nil: :empty,
|
|
94
|
-
empty: :empty,
|
|
95
|
-
omitted: :empty,
|
|
96
|
-
},
|
|
97
|
-
to: {
|
|
98
|
-
nil: :empty,
|
|
99
|
-
empty: :empty,
|
|
100
|
-
omitted: :empty,
|
|
101
|
-
},
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
# GML Union elements
|
|
105
|
-
map_element "Union", to: :gml_union,
|
|
106
|
-
value_map: {
|
|
107
|
-
from: {
|
|
108
|
-
nil: :empty,
|
|
109
|
-
empty: :empty,
|
|
110
|
-
omitted: :empty,
|
|
111
|
-
},
|
|
112
|
-
to: {
|
|
113
|
-
nil: :empty,
|
|
114
|
-
empty: :empty,
|
|
115
|
-
omitted: :empty,
|
|
116
|
-
},
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
# GML Enumeration elements
|
|
120
|
-
map_element "Enumeration", to: :gml_enumeration,
|
|
121
|
-
value_map: {
|
|
122
|
-
from: {
|
|
123
|
-
nil: :empty,
|
|
124
|
-
empty: :empty,
|
|
125
|
-
omitted: :empty,
|
|
126
|
-
},
|
|
127
|
-
to: {
|
|
128
|
-
nil: :empty,
|
|
129
|
-
empty: :empty,
|
|
130
|
-
omitted: :empty,
|
|
131
|
-
},
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
# GML Type elements
|
|
135
|
-
map_element "Type", to: :gml_type,
|
|
136
|
-
value_map: {
|
|
137
|
-
from: {
|
|
138
|
-
nil: :empty,
|
|
139
|
-
empty: :empty,
|
|
140
|
-
omitted: :empty,
|
|
141
|
-
},
|
|
142
|
-
to: {
|
|
143
|
-
nil: :empty,
|
|
144
|
-
empty: :empty,
|
|
145
|
-
omitted: :empty,
|
|
146
|
-
},
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
# GML FeatureType elements
|
|
150
|
-
map_element "FeatureType", to: :gml_feature_type,
|
|
151
|
-
value_map: {
|
|
152
|
-
from: {
|
|
153
|
-
nil: :empty,
|
|
154
|
-
empty: :empty,
|
|
155
|
-
omitted: :empty,
|
|
156
|
-
},
|
|
157
|
-
to: {
|
|
158
|
-
nil: :empty,
|
|
159
|
-
empty: :empty,
|
|
160
|
-
omitted: :empty,
|
|
161
|
-
},
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
# GML property elements
|
|
165
|
-
map_element "property", to: :gml_property,
|
|
166
|
-
value_map: {
|
|
167
|
-
from: {
|
|
168
|
-
nil: :empty,
|
|
169
|
-
empty: :empty,
|
|
170
|
-
omitted: :empty,
|
|
171
|
-
},
|
|
172
|
-
to: {
|
|
173
|
-
nil: :empty,
|
|
174
|
-
empty: :empty,
|
|
175
|
-
omitted: :empty,
|
|
176
|
-
},
|
|
177
|
-
}
|
|
46
|
+
value_map: VM
|
|
47
|
+
map_element "CodeList", to: :gml_code_list, value_map: VM
|
|
48
|
+
map_element "DataType", to: :gml_data_type, value_map: VM
|
|
49
|
+
map_element "Union", to: :gml_union, value_map: VM
|
|
50
|
+
map_element "Enumeration", to: :gml_enumeration, value_map: VM
|
|
51
|
+
map_element "Type", to: :gml_type, value_map: VM
|
|
52
|
+
map_element "FeatureType", to: :gml_feature_type, value_map: VM
|
|
53
|
+
map_element "property", to: :gml_property, value_map: VM
|
|
178
54
|
end
|
|
179
55
|
end
|
|
180
56
|
end
|
data/lib/xmi/sparx/root.rb
CHANGED
|
@@ -22,18 +22,19 @@ module Xmi
|
|
|
22
22
|
class << self
|
|
23
23
|
# Parse XMI content into Ruby objects.
|
|
24
24
|
#
|
|
25
|
-
#
|
|
26
|
-
#
|
|
27
|
-
# their corresponding UML versions.
|
|
25
|
+
# Uses the ParserPipeline for composable parsing steps:
|
|
26
|
+
# encoding fix → version detection → XML parsing → index building.
|
|
28
27
|
#
|
|
29
28
|
# @param xml_content [String] The raw XMI XML content
|
|
30
|
-
# @return [SparxRoot] The parsed Ruby object
|
|
29
|
+
# @return [SparxRoot] The parsed Ruby object with index built
|
|
31
30
|
#
|
|
31
|
+
# @see Xmi::ParserPipeline
|
|
32
32
|
# @see Xmi.parse
|
|
33
33
|
def parse_xml(xml_content)
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
ctx = ParserPipeline.run(
|
|
35
|
+
{ xml: xml_content, root_class: self },
|
|
36
|
+
)
|
|
37
|
+
ctx[:root]
|
|
37
38
|
end
|
|
38
39
|
|
|
39
40
|
# Fix invalid UTF-8 encoding in the XML content.
|
|
@@ -55,6 +56,18 @@ module Xmi
|
|
|
55
56
|
|
|
56
57
|
# Use the reusable BaseMapping class instead of eval hack
|
|
57
58
|
xml SparxMappings::BaseMapping
|
|
59
|
+
|
|
60
|
+
# Build index for fast lookups
|
|
61
|
+
# @return [Sparx::Index]
|
|
62
|
+
def build_index
|
|
63
|
+
@index = Index.new(self)
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Access the index (builds on first access if needed)
|
|
67
|
+
# @return [Sparx::Index]
|
|
68
|
+
def index
|
|
69
|
+
@index || build_index
|
|
70
|
+
end
|
|
58
71
|
end
|
|
59
72
|
end
|
|
60
73
|
end
|
data/lib/xmi/sparx.rb
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class AnnotatedElement < Lutaml::Model::Serializable
|
|
6
|
+
attribute :idref, ::Xmi::Type::XmiIdRef
|
|
7
|
+
|
|
8
|
+
xml do
|
|
9
|
+
root "annotatedElement"
|
|
10
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
11
|
+
|
|
12
|
+
map_attribute "idref", to: :idref
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class AssociationGeneralization < Lutaml::Model::Serializable
|
|
6
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
7
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
8
|
+
attribute :general, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
root "generalization"
|
|
12
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
13
|
+
|
|
14
|
+
map_attribute "type", to: :type
|
|
15
|
+
map_attribute "id", to: :id
|
|
16
|
+
map_attribute "general", to: :general
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class Bounds < Lutaml::Model::Serializable
|
|
6
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
7
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
8
|
+
attribute :x, :integer
|
|
9
|
+
attribute :y, :integer
|
|
10
|
+
attribute :height, :integer
|
|
11
|
+
attribute :width, :integer
|
|
12
|
+
|
|
13
|
+
xml do
|
|
14
|
+
root "bounds"
|
|
15
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
16
|
+
|
|
17
|
+
map_attribute "type", to: :type
|
|
18
|
+
map_attribute "id", to: :id
|
|
19
|
+
map_attribute "x", to: :x
|
|
20
|
+
map_attribute "y", to: :y
|
|
21
|
+
map_attribute "height", to: :height
|
|
22
|
+
map_attribute "width", to: :width
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
class Waypoint < Lutaml::Model::Serializable
|
|
27
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
28
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
29
|
+
attribute :x, :integer
|
|
30
|
+
attribute :y, :integer
|
|
31
|
+
|
|
32
|
+
xml do
|
|
33
|
+
root "waypoint"
|
|
34
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
35
|
+
|
|
36
|
+
map_attribute "type", to: :type
|
|
37
|
+
map_attribute "id", to: :id
|
|
38
|
+
map_attribute "x", to: :x
|
|
39
|
+
map_attribute "y", to: :y
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class DefaultValue < Lutaml::Model::Serializable
|
|
6
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
7
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
8
|
+
attribute :value, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
root "defaultValue"
|
|
12
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
13
|
+
|
|
14
|
+
map_attribute "type", to: :type
|
|
15
|
+
map_attribute "id", to: :id
|
|
16
|
+
map_attribute "value", to: :value
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
class UpperValue < DefaultValue
|
|
21
|
+
xml do
|
|
22
|
+
root "upperValue"
|
|
23
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
24
|
+
|
|
25
|
+
map_attribute "type", to: :type
|
|
26
|
+
map_attribute "id", to: :id
|
|
27
|
+
map_attribute "value", to: :value
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
class LowerValue < DefaultValue
|
|
32
|
+
xml do
|
|
33
|
+
root "lowerValue"
|
|
34
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
35
|
+
|
|
36
|
+
map_attribute "type", to: :type
|
|
37
|
+
map_attribute "id", to: :id
|
|
38
|
+
map_attribute "value", to: :value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class Diagram < Lutaml::Model::Serializable
|
|
6
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
7
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
8
|
+
attribute :is_frame, :boolean
|
|
9
|
+
attribute :model_element, :string
|
|
10
|
+
attribute :owned_element, OwnedElement, collection: true
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
root "Diagram"
|
|
14
|
+
namespace ::Xmi::Namespace::Omg::UmlDi
|
|
15
|
+
|
|
16
|
+
map_attribute "type", to: :type
|
|
17
|
+
map_attribute "id", to: :id
|
|
18
|
+
map_attribute "isFrame", to: :is_frame
|
|
19
|
+
map_attribute "modelElement", to: :model_element
|
|
20
|
+
|
|
21
|
+
map_element "ownedElement", to: :owned_element, value_map: VALUE_MAP
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class MemberEnd < Lutaml::Model::Serializable
|
|
6
|
+
attribute :idref, ::Xmi::Type::XmiIdRef
|
|
7
|
+
|
|
8
|
+
xml do
|
|
9
|
+
root "memberEnd"
|
|
10
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
11
|
+
|
|
12
|
+
map_attribute "idref", to: :idref
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class OwnedAttribute < Lutaml::Model::Serializable
|
|
6
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
7
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
8
|
+
attribute :association, :string
|
|
9
|
+
attribute :name, :string
|
|
10
|
+
attribute :is_derived, :string
|
|
11
|
+
attribute :uml_type, Uml::Type
|
|
12
|
+
attribute :upper_value, UpperValue
|
|
13
|
+
attribute :lower_value, LowerValue
|
|
14
|
+
|
|
15
|
+
xml do
|
|
16
|
+
root "ownedAttribute"
|
|
17
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
18
|
+
|
|
19
|
+
map_attribute "type", to: :type
|
|
20
|
+
map_attribute "id", to: :id
|
|
21
|
+
map_attribute "association", to: :association
|
|
22
|
+
map_attribute "name", to: :name
|
|
23
|
+
map_attribute "isDerived", to: :is_derived
|
|
24
|
+
|
|
25
|
+
map_element "type", to: :uml_type
|
|
26
|
+
map_element "upperValue", to: :upper_value
|
|
27
|
+
map_element "lowerValue", to: :lower_value
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class OwnedComment < Lutaml::Model::Serializable
|
|
6
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
7
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
8
|
+
attribute :name, :string
|
|
9
|
+
attribute :body_element, :string
|
|
10
|
+
attribute :body_attribute, :string
|
|
11
|
+
attribute :annotated_attribute, :string
|
|
12
|
+
attribute :annotated_element, AnnotatedElement
|
|
13
|
+
|
|
14
|
+
xml do
|
|
15
|
+
root "ownedComment"
|
|
16
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
17
|
+
|
|
18
|
+
map_attribute "type", to: :type
|
|
19
|
+
map_attribute "id", to: :id
|
|
20
|
+
map_attribute "name", to: :name
|
|
21
|
+
map_attribute "body", to: :body_attribute
|
|
22
|
+
map_attribute "annotatedElement", to: :annotated_attribute
|
|
23
|
+
|
|
24
|
+
map_element "annotatedElement", to: :annotated_element
|
|
25
|
+
map_element "body", to: :body_element
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class OwnedElement < Lutaml::Model::Serializable
|
|
6
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
7
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
8
|
+
attribute :text, :string
|
|
9
|
+
attribute :model_element, :string
|
|
10
|
+
attribute :owned_element, OwnedElement, collection: true
|
|
11
|
+
attribute :bounds, Bounds, collection: true
|
|
12
|
+
attribute :source, :string
|
|
13
|
+
attribute :target, :string
|
|
14
|
+
attribute :waypoint, Waypoint
|
|
15
|
+
|
|
16
|
+
xml do
|
|
17
|
+
root "ownedElement"
|
|
18
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
19
|
+
|
|
20
|
+
map_attribute "type", to: :type
|
|
21
|
+
map_attribute "id", to: :id
|
|
22
|
+
map_attribute "text", to: :text
|
|
23
|
+
map_attribute "modelElement", to: :model_element
|
|
24
|
+
|
|
25
|
+
map_element "ownedElement", to: :owned_element, value_map: VALUE_MAP
|
|
26
|
+
map_element "bounds", to: :bounds, value_map: VALUE_MAP
|
|
27
|
+
map_element "source", to: :source
|
|
28
|
+
map_element "target", to: :target
|
|
29
|
+
map_element "waypoint", to: :waypoint
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class OwnedEnd < Lutaml::Model::Serializable
|
|
6
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
7
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
8
|
+
attribute :association, :string
|
|
9
|
+
attribute :name, :string
|
|
10
|
+
attribute :type_attr, :string
|
|
11
|
+
attribute :uml_type, Uml::Type
|
|
12
|
+
attribute :member_end, :string
|
|
13
|
+
attribute :lower, :integer
|
|
14
|
+
attribute :upper, :integer
|
|
15
|
+
attribute :is_composite, :boolean
|
|
16
|
+
|
|
17
|
+
xml do
|
|
18
|
+
root "ownedEnd"
|
|
19
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
20
|
+
|
|
21
|
+
map_attribute "type", to: :type
|
|
22
|
+
map_attribute "id", to: :id
|
|
23
|
+
map_attribute "association", to: :association
|
|
24
|
+
map_attribute "name", to: :name
|
|
25
|
+
map_attribute "memberEnd", to: :member_end
|
|
26
|
+
map_attribute "type", to: :type_attr
|
|
27
|
+
map_attribute "lower", to: :lower
|
|
28
|
+
map_attribute "upper", to: :upper
|
|
29
|
+
map_attribute "isComposite", to: :is_composite
|
|
30
|
+
map_element "type", to: :uml_type
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class OwnedLiteral < Lutaml::Model::Serializable
|
|
6
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
7
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
8
|
+
attribute :name, :string
|
|
9
|
+
attribute :uml_type, Uml::Type
|
|
10
|
+
|
|
11
|
+
xml do
|
|
12
|
+
root "ownedLiteral"
|
|
13
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
14
|
+
|
|
15
|
+
map_attribute "type", to: :type
|
|
16
|
+
map_attribute "id", to: :id
|
|
17
|
+
map_attribute "name", to: :name
|
|
18
|
+
|
|
19
|
+
map_element "type", to: :uml_type
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class OwnedOperation < Lutaml::Model::Serializable
|
|
6
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
7
|
+
attribute :name, :string
|
|
8
|
+
attribute :owned_parameter, OwnedParameter, collection: true
|
|
9
|
+
attribute :precondition, Precondition
|
|
10
|
+
attribute :uml_type, Uml::Type, collection: true
|
|
11
|
+
|
|
12
|
+
xml do
|
|
13
|
+
root "ownedOperation"
|
|
14
|
+
map_attribute "id", to: :id
|
|
15
|
+
map_attribute "name", to: :name
|
|
16
|
+
map_element "ownedParameter", to: :owned_parameter, value_map: VALUE_MAP
|
|
17
|
+
map_element "precondition", to: :precondition
|
|
18
|
+
map_element "type", to: :uml_type, value_map: VALUE_MAP
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class OwnedParameter < Lutaml::Model::Serializable
|
|
6
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
7
|
+
attribute :name, :string
|
|
8
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
9
|
+
attribute :direction, :string
|
|
10
|
+
attribute :upper_value, UpperValue
|
|
11
|
+
attribute :lower_value, LowerValue
|
|
12
|
+
attribute :default_value, DefaultValue
|
|
13
|
+
|
|
14
|
+
xml do
|
|
15
|
+
root "ownedParameter"
|
|
16
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
17
|
+
|
|
18
|
+
map_attribute "id", to: :id
|
|
19
|
+
map_attribute "name", to: :name
|
|
20
|
+
map_attribute "type", to: :type
|
|
21
|
+
map_attribute "direction", to: :direction
|
|
22
|
+
|
|
23
|
+
map_element "upperValue", to: :upper_value
|
|
24
|
+
map_element "lowerValue", to: :lower_value
|
|
25
|
+
map_element "defaultValue", to: :default_value
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class ImportedPackage < Lutaml::Model::Serializable
|
|
6
|
+
attribute :href, :string
|
|
7
|
+
|
|
8
|
+
xml do
|
|
9
|
+
root "importedPackage"
|
|
10
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
11
|
+
|
|
12
|
+
map_attribute "href", to: :href
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
class PackageImport < Lutaml::Model::Serializable
|
|
17
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
18
|
+
attribute :imported_package, ImportedPackage
|
|
19
|
+
|
|
20
|
+
xml do
|
|
21
|
+
root "packageImport"
|
|
22
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
23
|
+
|
|
24
|
+
map_attribute "id", to: :id
|
|
25
|
+
|
|
26
|
+
map_element "importedPackage", to: :imported_package
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|