xmi 0.5.10 → 0.5.12

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.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +102 -6
  3. data/Gemfile +0 -1
  4. data/TODO.next/01-packaged-element-typed-subclasses.md +94 -0
  5. data/TODO.next/03-real-sparx-instancespec-fixture.md +56 -0
  6. data/TODO.next/README.md +17 -0
  7. data/lib/xmi/namespace/omg.rb +6 -0
  8. data/lib/xmi/root.rb +2 -2
  9. data/lib/xmi/sparx/connector/appearance.rb +1 -0
  10. data/lib/xmi/sparx/connector/connector.rb +2 -0
  11. data/lib/xmi/sparx/connector/end_base.rb +2 -0
  12. data/lib/xmi/sparx/connector/end_constraint.rb +2 -0
  13. data/lib/xmi/sparx/connector/end_modifiers.rb +1 -0
  14. data/lib/xmi/sparx/connector/end_role.rb +1 -0
  15. data/lib/xmi/sparx/connector/end_style.rb +1 -0
  16. data/lib/xmi/sparx/connector/end_type.rb +1 -0
  17. data/lib/xmi/sparx/connector/labels.rb +1 -0
  18. data/lib/xmi/sparx/connector/properties.rb +1 -0
  19. data/lib/xmi/sparx/diagram.rb +5 -0
  20. data/lib/xmi/sparx/element/association.rb +4 -0
  21. data/lib/xmi/sparx/element/attribute.rb +2 -0
  22. data/lib/xmi/sparx/element/bounds.rb +1 -0
  23. data/lib/xmi/sparx/element/code.rb +1 -0
  24. data/lib/xmi/sparx/element/containment.rb +1 -0
  25. data/lib/xmi/sparx/element/coords.rb +1 -0
  26. data/lib/xmi/sparx/element/documentation.rb +1 -0
  27. data/lib/xmi/sparx/element/element.rb +2 -0
  28. data/lib/xmi/sparx/element/extended_properties.rb +1 -0
  29. data/lib/xmi/sparx/element/flags.rb +1 -0
  30. data/lib/xmi/sparx/element/links.rb +1 -0
  31. data/lib/xmi/sparx/element/model.rb +1 -1
  32. data/lib/xmi/sparx/element/package_properties.rb +1 -0
  33. data/lib/xmi/sparx/element/paths.rb +1 -0
  34. data/lib/xmi/sparx/element/project.rb +1 -0
  35. data/lib/xmi/sparx/element/properties.rb +1 -0
  36. data/lib/xmi/sparx/element/stereotype.rb +1 -0
  37. data/lib/xmi/sparx/element/style.rb +1 -0
  38. data/lib/xmi/sparx/element/styleex.rb +1 -0
  39. data/lib/xmi/sparx/element/tag.rb +2 -0
  40. data/lib/xmi/sparx/element/times.rb +1 -0
  41. data/lib/xmi/sparx/element/xrefs.rb +1 -0
  42. data/lib/xmi/sparx/mappings/base_mapping.rb +1 -1
  43. data/lib/xmi/sparx/primitive_type.rb +1 -0
  44. data/lib/xmi/uml/association.rb +12 -0
  45. data/lib/xmi/uml/association_class.rb +17 -0
  46. data/lib/xmi/uml/association_generalization.rb +1 -8
  47. data/lib/xmi/uml/base.rb +32 -0
  48. data/lib/xmi/uml/bounds.rb +1 -18
  49. data/lib/xmi/uml/data_type.rb +12 -0
  50. data/lib/xmi/uml/default_value.rb +7 -34
  51. data/lib/xmi/uml/dependency.rb +17 -0
  52. data/lib/xmi/uml/enumeration.rb +12 -0
  53. data/lib/xmi/uml/extension.rb +18 -0
  54. data/lib/xmi/uml/imported_package.rb +17 -0
  55. data/lib/xmi/uml/instance_specification.rb +13 -0
  56. data/lib/xmi/uml/interface.rb +12 -0
  57. data/lib/xmi/uml/interface_realization.rb +26 -0
  58. data/lib/xmi/uml/literal_boolean.rb +15 -0
  59. data/lib/xmi/uml/literal_integer.rb +15 -0
  60. data/lib/xmi/uml/literal_null.rb +14 -0
  61. data/lib/xmi/uml/literal_string.rb +15 -0
  62. data/lib/xmi/uml/literal_unlimited_natural.rb +16 -0
  63. data/lib/xmi/uml/lower_value.rb +13 -0
  64. data/lib/xmi/uml/opaque_expression.rb +31 -0
  65. data/lib/xmi/uml/owned_attribute.rb +28 -13
  66. data/lib/xmi/uml/owned_comment.rb +1 -8
  67. data/lib/xmi/uml/owned_element.rb +1 -1
  68. data/lib/xmi/uml/owned_end.rb +15 -14
  69. data/lib/xmi/uml/owned_literal.rb +1 -9
  70. data/lib/xmi/uml/owned_operation.rb +11 -4
  71. data/lib/xmi/uml/owned_parameter.rb +18 -12
  72. data/lib/xmi/uml/package.rb +12 -0
  73. data/lib/xmi/uml/package_import.rb +2 -12
  74. data/lib/xmi/uml/packaged_element.rb +50 -10
  75. data/lib/xmi/uml/precondition.rb +1 -8
  76. data/lib/xmi/uml/primitive_type.rb +12 -0
  77. data/lib/xmi/uml/profile.rb +2 -17
  78. data/lib/xmi/uml/profile_application.rb +2 -14
  79. data/lib/xmi/uml/profile_application_applied_profile.rb +21 -0
  80. data/lib/xmi/uml/profile_attributes.rb +20 -0
  81. data/lib/xmi/uml/realization.rb +14 -0
  82. data/lib/xmi/uml/signal.rb +18 -0
  83. data/lib/xmi/uml/slot.rb +18 -0
  84. data/lib/xmi/uml/specification.rb +3 -8
  85. data/lib/xmi/uml/stereotype.rb +18 -0
  86. data/lib/xmi/uml/uml_class.rb +17 -0
  87. data/lib/xmi/uml/uml_model.rb +7 -11
  88. data/lib/xmi/uml/upper_value.rb +13 -0
  89. data/lib/xmi/uml/usage.rb +18 -0
  90. data/lib/xmi/uml/value_specification.rb +46 -0
  91. data/lib/xmi/uml/waypoint.rb +23 -0
  92. data/lib/xmi/uml.rb +32 -6
  93. data/lib/xmi/version.rb +1 -1
  94. data/lib/xmi.rb +17 -3
  95. data/xmi.gemspec +1 -1
  96. metadata +38 -4
@@ -2,10 +2,7 @@
2
2
 
3
3
  module Xmi
4
4
  module Uml
5
- class OwnedComment < Lutaml::Model::Serializable
6
- skip_reference_registration
7
- attribute :type, ::Xmi::Type::XmiType
8
- attribute :id, ::Xmi::Type::XmiId
5
+ class OwnedComment < Base
9
6
  attribute :name, :string
10
7
  attribute :body_element, :string
11
8
  attribute :body_attribute, :string
@@ -14,10 +11,6 @@ module Xmi
14
11
 
15
12
  xml do
16
13
  root "ownedComment"
17
- namespace ::Xmi::Namespace::Omg::Uml
18
-
19
- map_attribute "type", to: :type
20
- map_attribute "id", to: :id
21
14
  map_attribute "name", to: :name
22
15
  map_attribute "body", to: :body_attribute
23
16
  map_attribute "annotatedElement", to: :annotated_attribute
@@ -16,7 +16,7 @@ module Xmi
16
16
 
17
17
  xml do
18
18
  root "ownedElement"
19
- namespace ::Xmi::Namespace::Omg::Uml
19
+ namespace ::Xmi::Namespace::Omg::UmlDi
20
20
 
21
21
  map_attribute "type", to: :type
22
22
  map_attribute "id", to: :id
@@ -2,33 +2,34 @@
2
2
 
3
3
  module Xmi
4
4
  module Uml
5
- class OwnedEnd < Lutaml::Model::Serializable
6
- skip_reference_registration
7
- attribute :type, ::Xmi::Type::XmiType
8
- attribute :id, ::Xmi::Type::XmiId
5
+ class OwnedEnd < Base
9
6
  attribute :association, :string
10
7
  attribute :name, :string
11
- attribute :type_attr, :string
8
+ attribute :visibility, :string
9
+ attribute :aggregation, :string
12
10
  attribute :uml_type, Uml::Type
13
11
  attribute :member_end, :string
14
- attribute :lower, :integer
15
- attribute :upper, :integer
12
+ attribute :upper_value, ValueSpecification, polymorphic: true
13
+ attribute :lower_value, ValueSpecification, polymorphic: true
14
+ attribute :default_value, ValueSpecification, polymorphic: true
16
15
  attribute :is_composite, :boolean
17
16
 
18
17
  xml do
19
18
  root "ownedEnd"
20
- namespace ::Xmi::Namespace::Omg::Uml
21
-
22
- map_attribute "type", to: :type
23
- map_attribute "id", to: :id
24
19
  map_attribute "association", to: :association
25
20
  map_attribute "name", to: :name
21
+ map_attribute "visibility", to: :visibility
22
+ map_attribute "aggregation", to: :aggregation
26
23
  map_attribute "memberEnd", to: :member_end
27
- map_attribute "type", to: :type_attr
28
- map_attribute "lower", to: :lower
29
- map_attribute "upper", to: :upper
30
24
  map_attribute "isComposite", to: :is_composite
25
+
31
26
  map_element "type", to: :uml_type
27
+ map_element "upperValue", to: :upper_value,
28
+ polymorphic: VALUE_SPECIFICATION_POLYMORPHIC_MAP
29
+ map_element "lowerValue", to: :lower_value,
30
+ polymorphic: VALUE_SPECIFICATION_POLYMORPHIC_MAP
31
+ map_element "defaultValue", to: :default_value,
32
+ polymorphic: VALUE_SPECIFICATION_POLYMORPHIC_MAP
32
33
  end
33
34
  end
34
35
  end
@@ -2,21 +2,13 @@
2
2
 
3
3
  module Xmi
4
4
  module Uml
5
- class OwnedLiteral < Lutaml::Model::Serializable
6
- skip_reference_registration
7
- attribute :type, ::Xmi::Type::XmiType
8
- attribute :id, ::Xmi::Type::XmiId
5
+ class OwnedLiteral < Base
9
6
  attribute :name, :string
10
7
  attribute :uml_type, Uml::Type
11
8
 
12
9
  xml do
13
10
  root "ownedLiteral"
14
- namespace ::Xmi::Namespace::Omg::Uml
15
-
16
- map_attribute "type", to: :type
17
- map_attribute "id", to: :id
18
11
  map_attribute "name", to: :name
19
-
20
12
  map_element "type", to: :uml_type
21
13
  end
22
14
  end
@@ -2,18 +2,25 @@
2
2
 
3
3
  module Xmi
4
4
  module Uml
5
- class OwnedOperation < Lutaml::Model::Serializable
6
- skip_reference_registration
7
- attribute :id, ::Xmi::Type::XmiId
5
+ class OwnedOperation < Base
8
6
  attribute :name, :string
7
+ attribute :visibility, :string
8
+ attribute :is_static, :boolean
9
+ attribute :is_abstract, :boolean
10
+ attribute :is_query, :boolean
11
+ attribute :concurrency, :string
9
12
  attribute :owned_parameter, OwnedParameter, collection: true
10
13
  attribute :precondition, Precondition
11
14
  attribute :uml_type, Uml::Type, collection: true
12
15
 
13
16
  xml do
14
17
  root "ownedOperation"
15
- map_attribute "id", to: :id
16
18
  map_attribute "name", to: :name
19
+ map_attribute "visibility", to: :visibility
20
+ map_attribute "isStatic", to: :is_static
21
+ map_attribute "isAbstract", to: :is_abstract
22
+ map_attribute "isQuery", to: :is_query
23
+ map_attribute "concurrency", to: :concurrency
17
24
  map_element "ownedParameter", to: :owned_parameter, value_map: VALUE_MAP
18
25
  map_element "precondition", to: :precondition
19
26
  map_element "type", to: :uml_type, value_map: VALUE_MAP
@@ -2,28 +2,34 @@
2
2
 
3
3
  module Xmi
4
4
  module Uml
5
- class OwnedParameter < Lutaml::Model::Serializable
6
- skip_reference_registration
7
- attribute :id, ::Xmi::Type::XmiId
5
+ class OwnedParameter < Base
8
6
  attribute :name, :string
9
7
  attribute :type, ::Xmi::Type::XmiType
10
8
  attribute :direction, :string
11
- attribute :upper_value, UpperValue
12
- attribute :lower_value, LowerValue
13
- attribute :default_value, DefaultValue
9
+ attribute :visibility, :string
10
+ attribute :is_ordered, :boolean
11
+ attribute :is_unique, :boolean
12
+ attribute :effect, :string
13
+ attribute :upper_value, ValueSpecification, polymorphic: true
14
+ attribute :lower_value, ValueSpecification, polymorphic: true
15
+ attribute :default_value, ValueSpecification, polymorphic: true
14
16
 
15
17
  xml do
16
18
  root "ownedParameter"
17
- namespace ::Xmi::Namespace::Omg::Uml
18
-
19
- map_attribute "id", to: :id
20
19
  map_attribute "name", to: :name
21
20
  map_attribute "type", to: :type
22
21
  map_attribute "direction", to: :direction
22
+ map_attribute "visibility", to: :visibility
23
+ map_attribute "isOrdered", to: :is_ordered
24
+ map_attribute "isUnique", to: :is_unique
25
+ map_attribute "effect", to: :effect
23
26
 
24
- map_element "upperValue", to: :upper_value
25
- map_element "lowerValue", to: :lower_value
26
- map_element "defaultValue", to: :default_value
27
+ map_element "upperValue", to: :upper_value,
28
+ polymorphic: VALUE_SPECIFICATION_POLYMORPHIC_MAP
29
+ map_element "lowerValue", to: :lower_value,
30
+ polymorphic: VALUE_SPECIFICATION_POLYMORPHIC_MAP
31
+ map_element "defaultValue", to: :default_value,
32
+ polymorphic: VALUE_SPECIFICATION_POLYMORPHIC_MAP
27
33
  end
28
34
  end
29
35
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "packaged_element"
4
+
5
+ module Xmi
6
+ module Uml
7
+ # UML `<packagedElement xmi:type="uml:Package">`. Container for
8
+ # nested packagedElement children.
9
+ class Package < PackagedElement
10
+ end
11
+ end
12
+ end
@@ -1,19 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "imported_package"
4
+
3
5
  module Xmi
4
6
  module Uml
5
- class ImportedPackage < Lutaml::Model::Serializable
6
- skip_reference_registration
7
- attribute :href, :string
8
-
9
- xml do
10
- root "importedPackage"
11
- namespace ::Xmi::Namespace::Omg::Uml
12
-
13
- map_attribute "href", to: :href
14
- end
15
- end
16
-
17
7
  class PackageImport < Lutaml::Model::Serializable
18
8
  attribute :id, ::Xmi::Type::XmiId
19
9
  attribute :imported_package, ImportedPackage
@@ -2,11 +2,42 @@
2
2
 
3
3
  module Xmi
4
4
  module Uml
5
- class PackagedElement < Lutaml::Model::Serializable
6
- skip_reference_registration
7
- attribute :type, ::Xmi::Type::XmiType
8
- attribute :id, ::Xmi::Type::XmiId
5
+ # Shared polymorphic dispatch map for any attribute whose value
6
+ # is a PackagedElement dispatched on `xmi:type`. Used by the
7
+ # packaged_element recursion on PackagedElement itself, and by
8
+ # UmlModel.packaged_element.
9
+ #
10
+ # Phase A of TODO.next/01: subclasses are type tags on
11
+ # PackagedElement (no attrs narrowed). Phase B will narrow each
12
+ # subclass's attrs to its UML-2.5-conformant subset.
13
+ PACKAGED_ELEMENT_POLYMORPHIC_MAP = {
14
+ attribute: "xmi:type",
15
+ class_map: {
16
+ "uml:Class" => "Xmi::Uml::UmlClass",
17
+ "uml:Association" => "Xmi::Uml::Association",
18
+ "uml:AssociationClass" => "Xmi::Uml::AssociationClass",
19
+ "uml:Interface" => "Xmi::Uml::Interface",
20
+ "uml:InstanceSpecification" => "Xmi::Uml::InstanceSpecification",
21
+ "uml:DataType" => "Xmi::Uml::DataType",
22
+ "uml:PrimitiveType" => "Xmi::Uml::PrimitiveType",
23
+ "uml:Enumeration" => "Xmi::Uml::Enumeration",
24
+ "uml:Package" => "Xmi::Uml::Package",
25
+ "uml:Realization" => "Xmi::Uml::Realization",
26
+ "uml:Dependency" => "Xmi::Uml::Dependency",
27
+ "uml:Signal" => "Xmi::Uml::Signal",
28
+ "uml:Extension" => "Xmi::Uml::Extension",
29
+ "uml:Stereotype" => "Xmi::Uml::Stereotype",
30
+ "uml:Usage" => "Xmi::Uml::Usage",
31
+ },
32
+ }.freeze
33
+
34
+ class PackagedElement < Base
9
35
  attribute :name, :string
36
+ attribute :visibility, :string
37
+ attribute :is_abstract, :boolean
38
+ attribute :is_leaf, :boolean
39
+ attribute :is_active, :boolean
40
+ attribute :classifier, :string
10
41
  attribute :member_end, :string
11
42
  attribute :member_ends, MemberEnd, collection: true
12
43
  attribute :owned_literal, OwnedLiteral, collection: true
@@ -16,19 +47,24 @@ module Xmi
16
47
  attribute :supplier, :string
17
48
  attribute :client, :string
18
49
 
19
- attribute :packaged_element, PackagedElement, collection: true
50
+ attribute :packaged_element, PackagedElement, collection: true,
51
+ polymorphic: true
20
52
  attribute :owned_end, OwnedEnd, collection: true
21
53
  attribute :owned_attribute, OwnedAttribute, collection: true
22
54
  attribute :owned_comment, OwnedComment, collection: true
23
55
  attribute :generalization, AssociationGeneralization, collection: true
56
+ attribute :interface_realization, InterfaceRealization, collection: true
57
+ attribute :slot, Slot, collection: true
58
+ attribute :specification, Specification
24
59
 
25
60
  xml do
26
61
  root "packagedElement"
27
- namespace ::Xmi::Namespace::Omg::Uml
28
-
29
- map_attribute "type", to: :type
30
- map_attribute "id", to: :id
31
62
  map_attribute "name", to: :name
63
+ map_attribute "visibility", to: :visibility
64
+ map_attribute "isAbstract", to: :is_abstract
65
+ map_attribute "isLeaf", to: :is_leaf
66
+ map_attribute "isActive", to: :is_active
67
+ map_attribute "classifier", to: :classifier
32
68
  map_attribute "memberEnd", to: :member_end
33
69
 
34
70
  # EA specific
@@ -36,14 +72,18 @@ module Xmi
36
72
  map_attribute "client", to: :client
37
73
 
38
74
  map_element "generalization", to: :generalization, value_map: VALUE_MAP
75
+ map_element "interfaceRealization", to: :interface_realization,
76
+ value_map: VALUE_MAP
39
77
  map_element "ownedComment", to: :owned_comment, value_map: VALUE_MAP
40
78
  map_element "ownedEnd", to: :owned_end, value_map: VALUE_MAP
41
79
  map_element "ownedLiteral", to: :owned_literal, value_map: VALUE_MAP
42
80
  map_element "ownedAttribute", to: :owned_attribute, value_map: VALUE_MAP
43
81
  map_element "ownedOperation", to: :owned_operation, value_map: VALUE_MAP
44
82
  map_element "packagedElement", to: :packaged_element,
45
- value_map: VALUE_MAP
83
+ polymorphic: PACKAGED_ELEMENT_POLYMORPHIC_MAP
46
84
  map_element "memberEnd", to: :member_ends, value_map: VALUE_MAP
85
+ map_element "slot", to: :slot, value_map: VALUE_MAP
86
+ map_element "specification", to: :specification
47
87
  end
48
88
  end
49
89
  end
@@ -2,20 +2,13 @@
2
2
 
3
3
  module Xmi
4
4
  module Uml
5
- class Precondition < Lutaml::Model::Serializable
6
- skip_reference_registration
7
- attribute :id, ::Xmi::Type::XmiId
5
+ class Precondition < Base
8
6
  attribute :name, :string
9
- attribute :type, ::Xmi::Type::XmiType
10
7
  attribute :specification, Specification
11
8
 
12
9
  xml do
13
10
  root "precondition"
14
- namespace ::Xmi::Namespace::Omg::Uml
15
-
16
- map_attribute "id", to: :id
17
11
  map_attribute "name", to: :name
18
- map_attribute "type", to: :type
19
12
  map_element "specification", to: :specification
20
13
  end
21
14
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "packaged_element"
4
+
5
+ module Xmi
6
+ module Uml
7
+ # UML `<packagedElement xmi:type="uml:PrimitiveType">`.
8
+ # Built-in primitive (string, integer, boolean, etc.).
9
+ class PrimitiveType < PackagedElement
10
+ end
11
+ end
12
+ end
@@ -1,24 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "profile_attributes"
4
+
3
5
  module Xmi
4
6
  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
7
  class Profile < Lutaml::Model::Serializable
23
8
  skip_reference_registration
24
9
  include ProfileAttributes
@@ -1,21 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "profile_application_applied_profile"
4
+
3
5
  module Xmi
4
6
  module Uml
5
- class ProfileApplicationAppliedProfile < Lutaml::Model::Serializable
6
- skip_reference_registration
7
- attribute :type, ::Xmi::Type::XmiType
8
- attribute :href, :string
9
-
10
- xml do
11
- root "appliedProfile"
12
- namespace ::Xmi::Namespace::Omg::Uml
13
-
14
- map_attribute "type", to: :type
15
- map_attribute "href", to: :href
16
- end
17
- end
18
-
19
7
  class ProfileApplication < Lutaml::Model::Serializable
20
8
  attribute :type, ::Xmi::Type::XmiType
21
9
  attribute :id, ::Xmi::Type::XmiId
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Uml
5
+ # UML `<appliedProfile>` element — href reference to a Profile
6
+ # that has been applied to a Package. Child of `<profileApplication>`.
7
+ class ProfileApplicationAppliedProfile < Lutaml::Model::Serializable
8
+ skip_reference_registration
9
+ attribute :type, ::Xmi::Type::XmiType
10
+ attribute :href, :string
11
+
12
+ xml do
13
+ root "appliedProfile"
14
+ namespace ::Xmi::Namespace::Omg::Uml
15
+
16
+ map_attribute "type", to: :type
17
+ map_attribute "href", to: :href
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Shared attribute declarations for Profile-like classes.
4
+ # Mixed into Profile via `include ProfileAttributes`.
5
+ module Xmi
6
+ module Uml
7
+ module ProfileAttributes
8
+ def self.included(klass)
9
+ klass.class_eval do
10
+ attribute :packaged_element, PackagedElement, collection: true
11
+ attribute :package_import, PackageImport, collection: true
12
+ attribute :id, ::Xmi::Type::XmiId
13
+ attribute :name, :string
14
+ attribute :ns_prefix, :string
15
+ attribute :metamodel_reference, :string
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "packaged_element"
4
+
5
+ module Xmi
6
+ module Uml
7
+ # UML `<packagedElement xmi:type="uml:Realization">`. Generic
8
+ # realization relationship. Note Sparx EA collapses strict
9
+ # `<interfaceRealization>` into this generic form; see
10
+ # InterfaceRealization for the strict-OMG form.
11
+ class Realization < PackagedElement
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "packaged_element"
4
+
5
+ module Xmi
6
+ module Uml
7
+ # UML `<packagedElement xmi:type="uml:Signal">`. A signal is a
8
+ # classifier that communicates the sending of a message instance
9
+ # (UML 2.5 §17.4).
10
+ #
11
+ # Phase A of TODO.next/01: subclass is a type tag on
12
+ # PackagedElement. The union-bag attribute set is inherited
13
+ # unchanged so existing consumers keep working. Phase B
14
+ # (narrowing attrs to the subclass) is future work.
15
+ class Signal < PackagedElement
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Uml
5
+ class Slot < Base
6
+ attribute :defining_feature, :string
7
+ attribute :value, ValueSpecification, collection: true, polymorphic: true
8
+
9
+ xml do
10
+ root "slot"
11
+ map_attribute "definingFeature", to: :defining_feature
12
+
13
+ map_element "value", to: :value,
14
+ polymorphic: VALUE_SPECIFICATION_POLYMORPHIC_MAP
15
+ end
16
+ end
17
+ end
18
+ end
@@ -2,19 +2,14 @@
2
2
 
3
3
  module Xmi
4
4
  module Uml
5
- class Specification < Lutaml::Model::Serializable
6
- skip_reference_registration
7
- attribute :id, ::Xmi::Type::XmiId
8
- attribute :type, ::Xmi::Type::XmiType
5
+ class Specification < Base
9
6
  attribute :language, :string
7
+ attribute :content, :string
10
8
 
11
9
  xml do
12
10
  root "specification"
13
- namespace ::Xmi::Namespace::Omg::Uml
14
-
15
- map_attribute "id", to: :id
16
- map_attribute "type", to: :type
17
11
  map_attribute "language", to: :language
12
+ map_content to: :content
18
13
  end
19
14
  end
20
15
  end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "packaged_element"
4
+
5
+ module Xmi
6
+ module Uml
7
+ # UML `<packagedElement xmi:type="uml:Stereotype">. A stereotype
8
+ # is a kind of class defined to extend the UML metamodel
9
+ # (UML 2.5 §22.3).
10
+ #
11
+ # Phase A of TODO.next/01: subclass is a type tag on
12
+ # PackagedElement. The union-bag attribute set is inherited
13
+ # unchanged so existing consumers keep working. Phase B
14
+ # (narrowing attrs to the subclass) is future work.
15
+ class Stereotype < PackagedElement
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "packaged_element"
4
+
5
+ module Xmi
6
+ module Uml
7
+ # UML `<packagedElement xmi:type="uml:Class">`. Classifier with
8
+ # attributes, operations, and structural relationships.
9
+ #
10
+ # Phase A of TODO.next/01: subclass is a type tag on
11
+ # PackagedElement. The union-bag attribute set is inherited
12
+ # unchanged so existing consumers keep working. Phase B
13
+ # (narrowing attrs to the subclass) is future work.
14
+ class UmlClass < PackagedElement
15
+ end
16
+ end
17
+ end
@@ -1,29 +1,25 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "packaged_element"
4
+
3
5
  module Xmi
4
6
  module Uml
5
- class UmlModel < Lutaml::Model::Serializable
6
- skip_reference_registration
7
- attribute :id, ::Xmi::Type::XmiId
8
- attribute :type, ::Xmi::Type::XmiType
7
+ class UmlModel < Base
9
8
  attribute :name, :string
10
9
  attribute :profile_application, ProfileApplication, collection: true
11
- attribute :packaged_element, PackagedElement, collection: true
10
+ attribute :packaged_element, PackagedElement, collection: true,
11
+ polymorphic: true
12
12
  attribute :package_import, PackageImport, collection: true
13
13
  attribute :diagram, Diagram
14
14
 
15
15
  xml do
16
16
  root "Model"
17
- namespace ::Xmi::Namespace::Omg::Uml
18
-
19
- map_attribute "id", to: :id
20
- map_attribute "type", to: :type
21
17
  map_attribute "name", to: :name
22
18
 
23
19
  map_element "packageImport", to: :package_import, value_map: VALUE_MAP
24
20
  map_element "packagedElement", to: :packaged_element,
25
- value_map: VALUE_MAP
26
- map_element "Diagram", to: :diagram
21
+ polymorphic: PACKAGED_ELEMENT_POLYMORPHIC_MAP
22
+ map_element "Diagram", to: :diagram, form: :qualified
27
23
  map_element "profileApplication", to: :profile_application,
28
24
  value_map: VALUE_MAP
29
25
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "default_value"
4
+
5
+ module Xmi
6
+ module Uml
7
+ class UpperValue < DefaultValue
8
+ xml do
9
+ root "upperValue"
10
+ end
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "packaged_element"
4
+
5
+ module Xmi
6
+ module Uml
7
+ # UML `<packagedElement xmi:type="uml:Usage">. A Dependency
8
+ # subtype indicating that a client requires a supplier for its
9
+ # proper functioning (UML 2.5 §19.3).
10
+ #
11
+ # Phase A of TODO.next/01: subclass is a type tag on
12
+ # PackagedElement. The union-bag attribute set is inherited
13
+ # unchanged so existing consumers keep working. Phase B
14
+ # (narrowing attrs to the subclass) is future work.
15
+ class Usage < PackagedElement
16
+ end
17
+ end
18
+ end