xmi 0.5.3 → 0.5.5
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/.rubocop_todo.yml +31 -45
- data/README.adoc +0 -15
- data/lib/xmi/custom_profile/abstract.rb +16 -0
- data/lib/xmi/custom_profile/basic_doc.rb +16 -0
- data/lib/xmi/custom_profile/bibliography.rb +16 -0
- data/lib/xmi/custom_profile/edition.rb +18 -0
- data/lib/xmi/custom_profile/enumeration.rb +16 -0
- data/lib/xmi/custom_profile/informative.rb +16 -0
- data/lib/xmi/custom_profile/invariant.rb +16 -0
- data/lib/xmi/custom_profile/number.rb +18 -0
- data/lib/xmi/custom_profile/ocl.rb +16 -0
- data/lib/xmi/custom_profile/persistence.rb +20 -0
- data/lib/xmi/custom_profile/publication_date.rb +18 -0
- data/lib/xmi/custom_profile/year_version.rb +18 -0
- data/lib/xmi/custom_profile.rb +12 -143
- data/lib/xmi/ea_root/code_generation.rb +141 -0
- data/lib/xmi/ea_root/extension_lifecycle.rb +52 -0
- data/lib/xmi/ea_root/namespace_handling.rb +39 -0
- data/lib/xmi/ea_root/xml_parsing.rb +51 -0
- data/lib/xmi/ea_root.rb +16 -403
- 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 +10 -11
- 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/xmi_identity.rb +46 -0
- data/lib/xmi.rb +11 -7
- metadata +84 -3
- data/lib/xmi/index.rb +0 -243
|
@@ -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
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class PackagedElement < Lutaml::Model::Serializable
|
|
6
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
7
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
8
|
+
attribute :name, :string
|
|
9
|
+
attribute :member_end, :string
|
|
10
|
+
attribute :member_ends, MemberEnd, collection: true
|
|
11
|
+
attribute :owned_literal, OwnedLiteral, collection: true
|
|
12
|
+
attribute :owned_operation, OwnedOperation, collection: true
|
|
13
|
+
|
|
14
|
+
# EA specific
|
|
15
|
+
attribute :supplier, :string
|
|
16
|
+
attribute :client, :string
|
|
17
|
+
|
|
18
|
+
attribute :packaged_element, PackagedElement, collection: true
|
|
19
|
+
attribute :owned_end, OwnedEnd, collection: true
|
|
20
|
+
attribute :owned_attribute, OwnedAttribute, collection: true
|
|
21
|
+
attribute :owned_comment, OwnedComment, collection: true
|
|
22
|
+
attribute :generalization, AssociationGeneralization, collection: true
|
|
23
|
+
|
|
24
|
+
xml do
|
|
25
|
+
root "packagedElement"
|
|
26
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
27
|
+
|
|
28
|
+
map_attribute "type", to: :type
|
|
29
|
+
map_attribute "id", to: :id
|
|
30
|
+
map_attribute "name", to: :name
|
|
31
|
+
map_attribute "memberEnd", to: :member_end
|
|
32
|
+
|
|
33
|
+
# EA specific
|
|
34
|
+
map_attribute "supplier", to: :supplier
|
|
35
|
+
map_attribute "client", to: :client
|
|
36
|
+
|
|
37
|
+
map_element "generalization", to: :generalization, value_map: VALUE_MAP
|
|
38
|
+
map_element "ownedComment", to: :owned_comment, value_map: VALUE_MAP
|
|
39
|
+
map_element "ownedEnd", to: :owned_end, value_map: VALUE_MAP
|
|
40
|
+
map_element "ownedLiteral", to: :owned_literal, value_map: VALUE_MAP
|
|
41
|
+
map_element "ownedAttribute", to: :owned_attribute, value_map: VALUE_MAP
|
|
42
|
+
map_element "ownedOperation", to: :owned_operation, value_map: VALUE_MAP
|
|
43
|
+
map_element "packagedElement", to: :packaged_element,
|
|
44
|
+
value_map: VALUE_MAP
|
|
45
|
+
map_element "memberEnd", to: :member_ends, value_map: VALUE_MAP
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class Precondition < Lutaml::Model::Serializable
|
|
6
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
7
|
+
attribute :name, :string
|
|
8
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
9
|
+
attribute :specification, Specification
|
|
10
|
+
|
|
11
|
+
xml do
|
|
12
|
+
root "precondition"
|
|
13
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
14
|
+
|
|
15
|
+
map_attribute "id", to: :id
|
|
16
|
+
map_attribute "name", to: :name
|
|
17
|
+
map_attribute "type", to: :type
|
|
18
|
+
map_element "specification", to: :specification
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
module ProfileAttributes
|
|
6
|
+
def self.included(klass)
|
|
7
|
+
klass.class_eval do
|
|
8
|
+
attribute :packaged_element, PackagedElement, collection: true
|
|
9
|
+
attribute :package_import, PackageImport, collection: true
|
|
10
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
11
|
+
attribute :name, :string
|
|
12
|
+
# attribute :xmi, :string
|
|
13
|
+
# attribute :uml, :string
|
|
14
|
+
attribute :ns_prefix, :string
|
|
15
|
+
|
|
16
|
+
# Is this an EA thing?
|
|
17
|
+
attribute :metamodel_reference, :string
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
class Profile < Lutaml::Model::Serializable
|
|
23
|
+
include ProfileAttributes
|
|
24
|
+
|
|
25
|
+
attribute :owned_comment, OwnedComment, collection: true
|
|
26
|
+
|
|
27
|
+
xml do
|
|
28
|
+
root "Profile"
|
|
29
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
30
|
+
|
|
31
|
+
map_attribute "id", to: :id
|
|
32
|
+
map_attribute "name", to: :name
|
|
33
|
+
map_attribute "metamodelReference", to: :metamodel_reference
|
|
34
|
+
map_attribute "nsPrefix", to: :ns_prefix
|
|
35
|
+
|
|
36
|
+
map_element "ownedComment", to: :owned_comment, value_map: VALUE_MAP
|
|
37
|
+
map_element "packageImport", to: :package_import, value_map: VALUE_MAP
|
|
38
|
+
map_element "packagedElement", to: :packaged_element,
|
|
39
|
+
value_map: VALUE_MAP
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class ProfileApplicationAppliedProfile < Lutaml::Model::Serializable
|
|
6
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
7
|
+
attribute :href, :string
|
|
8
|
+
|
|
9
|
+
xml do
|
|
10
|
+
root "appliedProfile"
|
|
11
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
12
|
+
|
|
13
|
+
map_attribute "type", to: :type
|
|
14
|
+
map_attribute "href", to: :href
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
class ProfileApplication < Lutaml::Model::Serializable
|
|
19
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
20
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
21
|
+
attribute :applied_profile, ProfileApplicationAppliedProfile
|
|
22
|
+
|
|
23
|
+
xml do
|
|
24
|
+
root "profileApplication"
|
|
25
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
26
|
+
|
|
27
|
+
map_attribute "type", to: :type
|
|
28
|
+
map_attribute "id", to: :id
|
|
29
|
+
|
|
30
|
+
map_element "appliedProfile", to: :applied_profile
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class Specification < Lutaml::Model::Serializable
|
|
6
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
7
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
8
|
+
attribute :language, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
root "specification"
|
|
12
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
13
|
+
|
|
14
|
+
map_attribute "id", to: :id
|
|
15
|
+
map_attribute "type", to: :type
|
|
16
|
+
map_attribute "language", to: :language
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
data/lib/xmi/uml/type.rb
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class Type < Lutaml::Model::Serializable
|
|
6
|
+
attribute :idref, ::Xmi::Type::XmiIdRef
|
|
7
|
+
attribute :href, :string
|
|
8
|
+
|
|
9
|
+
xml do
|
|
10
|
+
root "type"
|
|
11
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
12
|
+
|
|
13
|
+
map_attribute "idref", to: :idref
|
|
14
|
+
map_attribute "href", to: :href
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
class UmlModel < Lutaml::Model::Serializable
|
|
6
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
7
|
+
attribute :name, :string
|
|
8
|
+
attribute :profile_application, ProfileApplication, collection: true
|
|
9
|
+
attribute :packaged_element, PackagedElement, collection: true
|
|
10
|
+
attribute :package_import, PackageImport, collection: true
|
|
11
|
+
attribute :diagram, Diagram
|
|
12
|
+
|
|
13
|
+
xml do
|
|
14
|
+
root "Model"
|
|
15
|
+
namespace ::Xmi::Namespace::Omg::Uml
|
|
16
|
+
|
|
17
|
+
map_attribute "type", to: :type
|
|
18
|
+
map_attribute "name", to: :name
|
|
19
|
+
|
|
20
|
+
map_element "packageImport", to: :package_import, value_map: VALUE_MAP
|
|
21
|
+
map_element "packagedElement", to: :packaged_element,
|
|
22
|
+
value_map: VALUE_MAP
|
|
23
|
+
map_element "Diagram", to: :diagram
|
|
24
|
+
map_element "profileApplication", to: :profile_application,
|
|
25
|
+
value_map: VALUE_MAP
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|