xmi 0.5.11 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +8 -0
- data/.rubocop_todo.yml +102 -7
- data/CLAUDE.md +43 -14
- data/lib/xmi/add.rb +0 -3
- data/lib/xmi/delete.rb +0 -3
- data/lib/xmi/difference.rb +0 -2
- data/lib/xmi/documentation.rb +0 -2
- data/lib/xmi/ea_root.rb +5 -4
- data/lib/xmi/namespace.rb +3 -3
- data/lib/xmi/replace.rb +0 -3
- data/lib/xmi/root.rb +0 -3
- data/lib/xmi/type.rb +0 -2
- data/lib/xmi/uml/association.rb +10 -0
- data/lib/xmi/uml/association_class.rb +15 -0
- data/lib/xmi/uml/association_generalization.rb +1 -8
- data/lib/xmi/uml/base.rb +32 -0
- data/lib/xmi/uml/bounds.rb +2 -25
- data/lib/xmi/uml/data_type.rb +10 -0
- data/lib/xmi/uml/default_value.rb +5 -34
- data/lib/xmi/uml/dependency.rb +15 -0
- data/lib/xmi/uml/diagram.rb +2 -8
- data/lib/xmi/uml/enumeration.rb +10 -0
- data/lib/xmi/uml/extension.rb +16 -0
- data/lib/xmi/uml/imported_package.rb +17 -0
- data/lib/xmi/uml/instance_specification.rb +11 -0
- data/lib/xmi/uml/interface.rb +10 -0
- data/lib/xmi/uml/interface_realization.rb +26 -0
- data/lib/xmi/uml/literal_boolean.rb +15 -0
- data/lib/xmi/uml/literal_integer.rb +15 -0
- data/lib/xmi/uml/literal_null.rb +14 -0
- data/lib/xmi/uml/literal_string.rb +15 -0
- data/lib/xmi/uml/literal_unlimited_natural.rb +16 -0
- data/lib/xmi/uml/lower_value.rb +11 -0
- data/lib/xmi/uml/opaque_expression.rb +31 -0
- data/lib/xmi/uml/owned_attribute.rb +28 -13
- data/lib/xmi/uml/owned_comment.rb +1 -8
- data/lib/xmi/uml/owned_element.rb +4 -8
- data/lib/xmi/uml/owned_end.rb +15 -12
- data/lib/xmi/uml/owned_literal.rb +1 -9
- data/lib/xmi/uml/owned_operation.rb +11 -4
- data/lib/xmi/uml/owned_parameter.rb +18 -12
- data/lib/xmi/uml/package.rb +10 -0
- data/lib/xmi/uml/package_import.rb +0 -12
- data/lib/xmi/uml/packaged_element.rb +50 -10
- data/lib/xmi/uml/precondition.rb +1 -8
- data/lib/xmi/uml/primitive_type.rb +10 -0
- data/lib/xmi/uml/profile.rb +11 -25
- data/lib/xmi/uml/profile_application.rb +4 -22
- data/lib/xmi/uml/profile_application_applied_profile.rb +21 -0
- data/lib/xmi/uml/realization.rb +12 -0
- data/lib/xmi/uml/signal.rb +16 -0
- data/lib/xmi/uml/slot.rb +18 -0
- data/lib/xmi/uml/specification.rb +3 -8
- data/lib/xmi/uml/stereotype.rb +16 -0
- data/lib/xmi/uml/uml_class.rb +15 -0
- data/lib/xmi/uml/uml_model.rb +4 -10
- data/lib/xmi/uml/upper_value.rb +11 -0
- data/lib/xmi/uml/usage.rb +16 -0
- data/lib/xmi/uml/value_specification.rb +46 -0
- data/lib/xmi/uml/waypoint.rb +17 -0
- data/lib/xmi/uml.rb +31 -6
- data/lib/xmi/uml_di/base.rb +22 -0
- data/lib/xmi/uml_di.rb +10 -0
- data/lib/xmi/version.rb +1 -1
- data/lib/xmi.rb +38 -27
- metadata +34 -2
|
@@ -2,32 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
module Xmi
|
|
4
4
|
module Uml
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
class ProfileApplication < Lutaml::Model::Serializable
|
|
20
|
-
attribute :type, ::Xmi::Type::XmiType
|
|
21
|
-
attribute :id, ::Xmi::Type::XmiId
|
|
5
|
+
# UML `<profileApplication>` element — records that a Profile has
|
|
6
|
+
# been applied to the containing Package. Carries a single
|
|
7
|
+
# `<appliedProfile>` child holding the href reference.
|
|
8
|
+
class ProfileApplication < Base
|
|
22
9
|
attribute :applied_profile, ProfileApplicationAppliedProfile
|
|
23
10
|
|
|
24
11
|
xml do
|
|
25
12
|
root "profileApplication"
|
|
26
|
-
namespace ::Xmi::Namespace::Omg::Uml
|
|
27
|
-
|
|
28
|
-
map_attribute "type", to: :type
|
|
29
|
-
map_attribute "id", to: :id
|
|
30
|
-
|
|
31
13
|
map_element "appliedProfile", to: :applied_profile
|
|
32
14
|
end
|
|
33
15
|
end
|
|
@@ -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,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
# UML `<packagedElement xmi:type="uml:Realization">`. Generic
|
|
6
|
+
# realization relationship. Note Sparx EA collapses strict
|
|
7
|
+
# `<interfaceRealization>` into this generic form; see
|
|
8
|
+
# InterfaceRealization for the strict-OMG form.
|
|
9
|
+
class Realization < PackagedElement
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
# UML `<packagedElement xmi:type="uml:Signal">`. A signal is a
|
|
6
|
+
# classifier that communicates the sending of a message instance
|
|
7
|
+
# (UML 2.5 §17.4).
|
|
8
|
+
#
|
|
9
|
+
# Phase A of TODO.next/01: subclass is a type tag on
|
|
10
|
+
# PackagedElement. The union-bag attribute set is inherited
|
|
11
|
+
# unchanged so existing consumers keep working. Phase B
|
|
12
|
+
# (narrowing attrs to the subclass) is future work.
|
|
13
|
+
class Signal < PackagedElement
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
data/lib/xmi/uml/slot.rb
ADDED
|
@@ -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 <
|
|
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,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
# UML `<packagedElement xmi:type="uml:Stereotype">. A stereotype
|
|
6
|
+
# is a kind of class defined to extend the UML metamodel
|
|
7
|
+
# (UML 2.5 §22.3).
|
|
8
|
+
#
|
|
9
|
+
# Phase A of TODO.next/01: subclass is a type tag on
|
|
10
|
+
# PackagedElement. The union-bag attribute set is inherited
|
|
11
|
+
# unchanged so existing consumers keep working. Phase B
|
|
12
|
+
# (narrowing attrs to the subclass) is future work.
|
|
13
|
+
class Stereotype < PackagedElement
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
# UML `<packagedElement xmi:type="uml:Class">`. Classifier with
|
|
6
|
+
# attributes, operations, and structural relationships.
|
|
7
|
+
#
|
|
8
|
+
# Phase A of TODO.next/01: subclass is a type tag on
|
|
9
|
+
# PackagedElement. The union-bag attribute set is inherited
|
|
10
|
+
# unchanged so existing consumers keep working. Phase B
|
|
11
|
+
# (narrowing attrs to the subclass) is future work.
|
|
12
|
+
class UmlClass < PackagedElement
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
data/lib/xmi/uml/uml_model.rb
CHANGED
|
@@ -2,27 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
module Xmi
|
|
4
4
|
module Uml
|
|
5
|
-
class UmlModel <
|
|
6
|
-
skip_reference_registration
|
|
7
|
-
attribute :id, ::Xmi::Type::XmiId
|
|
8
|
-
attribute :type, ::Xmi::Type::XmiType
|
|
5
|
+
class UmlModel < Base
|
|
9
6
|
attribute :name, :string
|
|
10
7
|
attribute :profile_application, ProfileApplication, collection: true
|
|
11
|
-
attribute :packaged_element, PackagedElement, collection: true
|
|
8
|
+
attribute :packaged_element, PackagedElement, collection: true,
|
|
9
|
+
polymorphic: true
|
|
12
10
|
attribute :package_import, PackageImport, collection: true
|
|
13
11
|
attribute :diagram, Diagram
|
|
14
12
|
|
|
15
13
|
xml do
|
|
16
14
|
root "Model"
|
|
17
|
-
namespace ::Xmi::Namespace::Omg::Uml
|
|
18
|
-
|
|
19
|
-
map_attribute "id", to: :id
|
|
20
|
-
map_attribute "type", to: :type
|
|
21
15
|
map_attribute "name", to: :name
|
|
22
16
|
|
|
23
17
|
map_element "packageImport", to: :package_import, value_map: VALUE_MAP
|
|
24
18
|
map_element "packagedElement", to: :packaged_element,
|
|
25
|
-
|
|
19
|
+
polymorphic: PACKAGED_ELEMENT_POLYMORPHIC_MAP
|
|
26
20
|
map_element "Diagram", to: :diagram, form: :qualified
|
|
27
21
|
map_element "profileApplication", to: :profile_application,
|
|
28
22
|
value_map: VALUE_MAP
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
# UML `<packagedElement xmi:type="uml:Usage">. A Dependency
|
|
6
|
+
# subtype indicating that a client requires a supplier for its
|
|
7
|
+
# proper functioning (UML 2.5 §19.3).
|
|
8
|
+
#
|
|
9
|
+
# Phase A of TODO.next/01: subclass is a type tag on
|
|
10
|
+
# PackagedElement. The union-bag attribute set is inherited
|
|
11
|
+
# unchanged so existing consumers keep working. Phase B
|
|
12
|
+
# (narrowing attrs to the subclass) is future work.
|
|
13
|
+
class Usage < PackagedElement
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
# Abstract UML ValueSpecification. UML 2.5 §9.8 — the abstract
|
|
6
|
+
# parent of OpaqueExpression, LiteralString, LiteralInteger,
|
|
7
|
+
# LiteralBoolean, LiteralUnlimitedNatural, LiteralNull, etc.
|
|
8
|
+
#
|
|
9
|
+
# Used as the type of `Slot#value` and other polymorphic value
|
|
10
|
+
# attributes so the parser can dispatch on `xmi:type` to the
|
|
11
|
+
# right concrete subclass.
|
|
12
|
+
#
|
|
13
|
+
# Concrete subclasses live in their own files (literal_string.rb,
|
|
14
|
+
# opaque_expression.rb, etc.). Add new literals as a new file plus
|
|
15
|
+
# an entry in POLYMORPHIC_MAP below — OCP-friendly, no edits to
|
|
16
|
+
# callers.
|
|
17
|
+
class ValueSpecification < Base
|
|
18
|
+
attribute :type, ::Xmi::Type::XmiType, polymorphic_class: true
|
|
19
|
+
|
|
20
|
+
xml do
|
|
21
|
+
root "valueSpecification"
|
|
22
|
+
map_attribute "type", to: :type
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Shared polymorphic dispatch map for any attribute whose value
|
|
27
|
+
# is a ValueSpecification dispatched on `xmi:type`. Consumers:
|
|
28
|
+
# Slot#value, OwnedAttribute#upper_value/#lower_value/#default_value,
|
|
29
|
+
# OwnedEnd#upper_value/#lower_value/#default_value,
|
|
30
|
+
# OwnedParameter#upper_value/#lower_value/#default_value.
|
|
31
|
+
#
|
|
32
|
+
# The literal class names are string form because lutaml-model's
|
|
33
|
+
# resolve_polymorphic_class calls Object.const_get on the value.
|
|
34
|
+
VALUE_SPECIFICATION_POLYMORPHIC_MAP = {
|
|
35
|
+
attribute: "xmi:type",
|
|
36
|
+
class_map: {
|
|
37
|
+
"uml:OpaqueExpression" => "Xmi::Uml::OpaqueExpression",
|
|
38
|
+
"uml:LiteralString" => "Xmi::Uml::LiteralString",
|
|
39
|
+
"uml:LiteralInteger" => "Xmi::Uml::LiteralInteger",
|
|
40
|
+
"uml:LiteralBoolean" => "Xmi::Uml::LiteralBoolean",
|
|
41
|
+
"uml:LiteralUnlimitedNatural" => "Xmi::Uml::LiteralUnlimitedNatural",
|
|
42
|
+
"uml:LiteralNull" => "Xmi::Uml::LiteralNull",
|
|
43
|
+
},
|
|
44
|
+
}.freeze
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
# UMLDI `<waypoint>` element — a point on a connector path.
|
|
6
|
+
class Waypoint < ::Xmi::UmlDi::Base
|
|
7
|
+
attribute :x, :integer
|
|
8
|
+
attribute :y, :integer
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
root "waypoint"
|
|
12
|
+
map_attribute "x", to: :x
|
|
13
|
+
map_attribute "y", to: :y
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
data/lib/xmi/uml.rb
CHANGED
|
@@ -2,12 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
module Xmi
|
|
4
4
|
module Uml
|
|
5
|
+
autoload :Base, "xmi/uml/base"
|
|
5
6
|
autoload :AnnotatedElement, "xmi/uml/annotated_element"
|
|
6
7
|
autoload :Type, "xmi/uml/type"
|
|
7
8
|
autoload :MemberEnd, "xmi/uml/member_end"
|
|
8
9
|
autoload :DefaultValue, "xmi/uml/default_value"
|
|
9
|
-
autoload :UpperValue, "xmi/uml/
|
|
10
|
-
autoload :LowerValue, "xmi/uml/
|
|
10
|
+
autoload :UpperValue, "xmi/uml/upper_value"
|
|
11
|
+
autoload :LowerValue, "xmi/uml/lower_value"
|
|
12
|
+
autoload :ValueSpecification, "xmi/uml/value_specification"
|
|
13
|
+
autoload :LiteralString, "xmi/uml/literal_string"
|
|
14
|
+
autoload :LiteralInteger, "xmi/uml/literal_integer"
|
|
15
|
+
autoload :LiteralBoolean, "xmi/uml/literal_boolean"
|
|
16
|
+
autoload :LiteralUnlimitedNatural, "xmi/uml/literal_unlimited_natural"
|
|
17
|
+
autoload :LiteralNull, "xmi/uml/literal_null"
|
|
18
|
+
autoload :OpaqueExpression, "xmi/uml/opaque_expression"
|
|
19
|
+
autoload :Slot, "xmi/uml/slot"
|
|
20
|
+
autoload :InterfaceRealization, "xmi/uml/interface_realization"
|
|
11
21
|
autoload :OwnedEnd, "xmi/uml/owned_end"
|
|
12
22
|
autoload :OwnedLiteral, "xmi/uml/owned_literal"
|
|
13
23
|
autoload :OwnedAttribute, "xmi/uml/owned_attribute"
|
|
@@ -18,16 +28,31 @@ module Xmi
|
|
|
18
28
|
autoload :OwnedComment, "xmi/uml/owned_comment"
|
|
19
29
|
autoload :AssociationGeneralization, "xmi/uml/association_generalization"
|
|
20
30
|
autoload :PackagedElement, "xmi/uml/packaged_element"
|
|
31
|
+
autoload :UmlClass, "xmi/uml/uml_class"
|
|
32
|
+
autoload :Association, "xmi/uml/association"
|
|
33
|
+
autoload :Interface, "xmi/uml/interface"
|
|
34
|
+
autoload :InstanceSpecification, "xmi/uml/instance_specification"
|
|
35
|
+
autoload :DataType, "xmi/uml/data_type"
|
|
36
|
+
autoload :PrimitiveType, "xmi/uml/primitive_type"
|
|
37
|
+
autoload :Enumeration, "xmi/uml/enumeration"
|
|
38
|
+
autoload :Package, "xmi/uml/package"
|
|
39
|
+
autoload :Realization, "xmi/uml/realization"
|
|
40
|
+
autoload :Dependency, "xmi/uml/dependency"
|
|
41
|
+
autoload :Signal, "xmi/uml/signal"
|
|
42
|
+
autoload :AssociationClass, "xmi/uml/association_class"
|
|
43
|
+
autoload :Extension, "xmi/uml/extension"
|
|
44
|
+
autoload :Stereotype, "xmi/uml/stereotype"
|
|
45
|
+
autoload :Usage, "xmi/uml/usage"
|
|
21
46
|
autoload :Bounds, "xmi/uml/bounds"
|
|
22
|
-
autoload :Waypoint, "xmi/uml/
|
|
47
|
+
autoload :Waypoint, "xmi/uml/waypoint"
|
|
23
48
|
autoload :OwnedElement, "xmi/uml/owned_element"
|
|
24
49
|
autoload :Diagram, "xmi/uml/diagram"
|
|
25
|
-
autoload :ProfileApplicationAppliedProfile,
|
|
50
|
+
autoload :ProfileApplicationAppliedProfile,
|
|
51
|
+
"xmi/uml/profile_application_applied_profile"
|
|
26
52
|
autoload :ProfileApplication, "xmi/uml/profile_application"
|
|
27
|
-
autoload :ImportedPackage, "xmi/uml/
|
|
53
|
+
autoload :ImportedPackage, "xmi/uml/imported_package"
|
|
28
54
|
autoload :PackageImport, "xmi/uml/package_import"
|
|
29
55
|
autoload :UmlModel, "xmi/uml/uml_model"
|
|
30
|
-
autoload :ProfileAttributes, "xmi/uml/profile"
|
|
31
56
|
autoload :Profile, "xmi/uml/profile"
|
|
32
57
|
end
|
|
33
58
|
end
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module UmlDi
|
|
5
|
+
# Common base for concrete UMLDI element classes. Parallel to
|
|
6
|
+
# Xmi::Uml::Base but in the UMLDI namespace (diagram interchange).
|
|
7
|
+
#
|
|
8
|
+
# Subclasses declare only their unique attributes + root element.
|
|
9
|
+
class Base < Lutaml::Model::Serializable
|
|
10
|
+
skip_reference_registration
|
|
11
|
+
attribute :type, ::Xmi::Type::XmiType
|
|
12
|
+
attribute :id, ::Xmi::Type::XmiId
|
|
13
|
+
|
|
14
|
+
xml do
|
|
15
|
+
namespace ::Xmi::Namespace::Omg::UmlDi
|
|
16
|
+
|
|
17
|
+
map_attribute "type", to: :type
|
|
18
|
+
map_attribute "id", to: :id
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
data/lib/xmi/uml_di.rb
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
# UML Diagram Interchange (UMLDI) classes. Parallel to Xmi::Uml
|
|
5
|
+
# but in the UMLDI namespace (http://www.omg.org/spec/UML/20131001/UMLDI).
|
|
6
|
+
# Used for diagram elements: Bounds, Waypoint, Diagram, OwnedElement.
|
|
7
|
+
module UmlDi
|
|
8
|
+
autoload :Base, "xmi/uml_di/base"
|
|
9
|
+
end
|
|
10
|
+
end
|
data/lib/xmi/version.rb
CHANGED
data/lib/xmi.rb
CHANGED
|
@@ -16,44 +16,55 @@ module Lutaml
|
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
require_relative "xmi/version"
|
|
20
|
-
require_relative "xmi/namespace"
|
|
21
|
-
require_relative "xmi/namespace/dynamic"
|
|
22
|
-
require_relative "xmi/type"
|
|
23
|
-
require_relative "xmi/namespace_detector"
|
|
24
|
-
require_relative "xmi/namespace_registry"
|
|
25
|
-
require_relative "xmi/xmi_identity"
|
|
26
|
-
|
|
27
19
|
module Xmi
|
|
20
|
+
autoload :VERSION, "xmi/version"
|
|
21
|
+
autoload :Namespace, "xmi/namespace"
|
|
22
|
+
autoload :Type, "xmi/type"
|
|
23
|
+
autoload :NamespaceDetector, "xmi/namespace_detector"
|
|
24
|
+
autoload :NamespaceRegistry, "xmi/namespace_registry"
|
|
25
|
+
autoload :XmiIdentity, "xmi/xmi_identity"
|
|
26
|
+
autoload :Versioned, "xmi/versioned"
|
|
27
|
+
autoload :VersionRegistry, "xmi/version_registry"
|
|
28
|
+
autoload :V20110701, "xmi/v20110701"
|
|
29
|
+
autoload :V20131001, "xmi/v20131001"
|
|
30
|
+
autoload :V20161101, "xmi/v20161101"
|
|
31
|
+
autoload :Add, "xmi/add"
|
|
32
|
+
autoload :Delete, "xmi/delete"
|
|
33
|
+
autoload :Difference, "xmi/difference"
|
|
34
|
+
autoload :Documentation, "xmi/documentation"
|
|
35
|
+
autoload :Extension, "xmi/extension"
|
|
36
|
+
autoload :Replace, "xmi/replace"
|
|
37
|
+
autoload :EaRoot, "xmi/ea_root"
|
|
38
|
+
autoload :Uml, "xmi/uml"
|
|
39
|
+
autoload :UmlDi, "xmi/uml_di"
|
|
40
|
+
|
|
28
41
|
class Error < StandardError; end
|
|
29
42
|
|
|
30
|
-
# Shared value_map for XMI elements
|
|
31
|
-
#
|
|
43
|
+
# Shared value_map for XMI elements.
|
|
44
|
+
#
|
|
45
|
+
# Parsing (`from:`) stays flexible: nil / empty / omitted all map
|
|
46
|
+
# to the symbol `:empty`, which the parser uses to materialise an
|
|
47
|
+
# empty model on the attribute. This preserves absence-vs-empty
|
|
48
|
+
# distinctions on the way IN.
|
|
49
|
+
#
|
|
50
|
+
# Serialization (`to:`) is generation-friendly: nil / empty /
|
|
51
|
+
# omitted all map to `:omitted`, which means "do not emit the
|
|
52
|
+
# element". This eliminates the post-processing step the ea gem
|
|
53
|
+
# previously needed (XmlSanitizer) to strip truly-empty elements
|
|
54
|
+
# that real Sparx XMI never carries.
|
|
55
|
+
#
|
|
56
|
+
# This is a breaking change from the previous symmetric VALUE_MAP
|
|
57
|
+
# (which emitted `<child/>` for empty collections). Consumers that
|
|
58
|
+
# relied on empty-element round-trip must update.
|
|
32
59
|
VALUE_MAP = {
|
|
33
60
|
from: { nil: :empty, empty: :empty, omitted: :empty },
|
|
34
|
-
to: { nil: :
|
|
61
|
+
to: { nil: :omitted, empty: :omitted, omitted: :omitted },
|
|
35
62
|
}.freeze
|
|
36
63
|
end
|
|
37
64
|
|
|
38
65
|
# Bootstrap the namespace registry
|
|
39
66
|
Xmi::NamespaceRegistry.bootstrap!
|
|
40
67
|
|
|
41
|
-
# Version infrastructure
|
|
42
|
-
require_relative "xmi/versioned"
|
|
43
|
-
require_relative "xmi/version_registry"
|
|
44
|
-
require_relative "xmi/v20110701"
|
|
45
|
-
require_relative "xmi/v20131001"
|
|
46
|
-
require_relative "xmi/v20161101"
|
|
47
|
-
|
|
48
|
-
require_relative "xmi/add"
|
|
49
|
-
require_relative "xmi/delete"
|
|
50
|
-
require_relative "xmi/difference"
|
|
51
|
-
require_relative "xmi/documentation"
|
|
52
|
-
require_relative "xmi/extension"
|
|
53
|
-
require_relative "xmi/replace"
|
|
54
|
-
require_relative "xmi/ea_root"
|
|
55
|
-
require_relative "xmi/uml"
|
|
56
|
-
|
|
57
68
|
module Xmi
|
|
58
69
|
# Lazy-loaded top-level modules — autoload avoids loading these
|
|
59
70
|
# until their constants are actually referenced at runtime.
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: xmi
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: lutaml-model
|
|
@@ -159,11 +159,29 @@ files:
|
|
|
159
159
|
- lib/xmi/type.rb
|
|
160
160
|
- lib/xmi/uml.rb
|
|
161
161
|
- lib/xmi/uml/annotated_element.rb
|
|
162
|
+
- lib/xmi/uml/association.rb
|
|
163
|
+
- lib/xmi/uml/association_class.rb
|
|
162
164
|
- lib/xmi/uml/association_generalization.rb
|
|
165
|
+
- lib/xmi/uml/base.rb
|
|
163
166
|
- lib/xmi/uml/bounds.rb
|
|
167
|
+
- lib/xmi/uml/data_type.rb
|
|
164
168
|
- lib/xmi/uml/default_value.rb
|
|
169
|
+
- lib/xmi/uml/dependency.rb
|
|
165
170
|
- lib/xmi/uml/diagram.rb
|
|
171
|
+
- lib/xmi/uml/enumeration.rb
|
|
172
|
+
- lib/xmi/uml/extension.rb
|
|
173
|
+
- lib/xmi/uml/imported_package.rb
|
|
174
|
+
- lib/xmi/uml/instance_specification.rb
|
|
175
|
+
- lib/xmi/uml/interface.rb
|
|
176
|
+
- lib/xmi/uml/interface_realization.rb
|
|
177
|
+
- lib/xmi/uml/literal_boolean.rb
|
|
178
|
+
- lib/xmi/uml/literal_integer.rb
|
|
179
|
+
- lib/xmi/uml/literal_null.rb
|
|
180
|
+
- lib/xmi/uml/literal_string.rb
|
|
181
|
+
- lib/xmi/uml/literal_unlimited_natural.rb
|
|
182
|
+
- lib/xmi/uml/lower_value.rb
|
|
166
183
|
- lib/xmi/uml/member_end.rb
|
|
184
|
+
- lib/xmi/uml/opaque_expression.rb
|
|
167
185
|
- lib/xmi/uml/owned_attribute.rb
|
|
168
186
|
- lib/xmi/uml/owned_comment.rb
|
|
169
187
|
- lib/xmi/uml/owned_element.rb
|
|
@@ -171,14 +189,28 @@ files:
|
|
|
171
189
|
- lib/xmi/uml/owned_literal.rb
|
|
172
190
|
- lib/xmi/uml/owned_operation.rb
|
|
173
191
|
- lib/xmi/uml/owned_parameter.rb
|
|
192
|
+
- lib/xmi/uml/package.rb
|
|
174
193
|
- lib/xmi/uml/package_import.rb
|
|
175
194
|
- lib/xmi/uml/packaged_element.rb
|
|
176
195
|
- lib/xmi/uml/precondition.rb
|
|
196
|
+
- lib/xmi/uml/primitive_type.rb
|
|
177
197
|
- lib/xmi/uml/profile.rb
|
|
178
198
|
- lib/xmi/uml/profile_application.rb
|
|
199
|
+
- lib/xmi/uml/profile_application_applied_profile.rb
|
|
200
|
+
- lib/xmi/uml/realization.rb
|
|
201
|
+
- lib/xmi/uml/signal.rb
|
|
202
|
+
- lib/xmi/uml/slot.rb
|
|
179
203
|
- lib/xmi/uml/specification.rb
|
|
204
|
+
- lib/xmi/uml/stereotype.rb
|
|
180
205
|
- lib/xmi/uml/type.rb
|
|
206
|
+
- lib/xmi/uml/uml_class.rb
|
|
181
207
|
- lib/xmi/uml/uml_model.rb
|
|
208
|
+
- lib/xmi/uml/upper_value.rb
|
|
209
|
+
- lib/xmi/uml/usage.rb
|
|
210
|
+
- lib/xmi/uml/value_specification.rb
|
|
211
|
+
- lib/xmi/uml/waypoint.rb
|
|
212
|
+
- lib/xmi/uml_di.rb
|
|
213
|
+
- lib/xmi/uml_di/base.rb
|
|
182
214
|
- lib/xmi/v20110701.rb
|
|
183
215
|
- lib/xmi/v20131001.rb
|
|
184
216
|
- lib/xmi/v20161101.rb
|