xmi 0.5.11 → 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.
- checksums.yaml +4 -4
- data/.rubocop_todo.yml +102 -7
- data/TODO.next/01-packaged-element-typed-subclasses.md +94 -0
- data/TODO.next/03-real-sparx-instancespec-fixture.md +56 -0
- data/TODO.next/README.md +17 -0
- data/lib/xmi/uml/association.rb +12 -0
- data/lib/xmi/uml/association_class.rb +17 -0
- data/lib/xmi/uml/association_generalization.rb +1 -8
- data/lib/xmi/uml/base.rb +32 -0
- data/lib/xmi/uml/bounds.rb +0 -17
- data/lib/xmi/uml/data_type.rb +12 -0
- data/lib/xmi/uml/default_value.rb +7 -34
- data/lib/xmi/uml/dependency.rb +17 -0
- data/lib/xmi/uml/enumeration.rb +12 -0
- data/lib/xmi/uml/extension.rb +18 -0
- data/lib/xmi/uml/imported_package.rb +17 -0
- data/lib/xmi/uml/instance_specification.rb +13 -0
- data/lib/xmi/uml/interface.rb +12 -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 +13 -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_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 +12 -0
- data/lib/xmi/uml/package_import.rb +2 -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 +12 -0
- data/lib/xmi/uml/profile.rb +2 -17
- data/lib/xmi/uml/profile_application.rb +2 -14
- data/lib/xmi/uml/profile_application_applied_profile.rb +21 -0
- data/lib/xmi/uml/profile_attributes.rb +20 -0
- data/lib/xmi/uml/realization.rb +14 -0
- data/lib/xmi/uml/signal.rb +18 -0
- data/lib/xmi/uml/slot.rb +18 -0
- data/lib/xmi/uml/specification.rb +3 -8
- data/lib/xmi/uml/stereotype.rb +18 -0
- data/lib/xmi/uml/uml_class.rb +17 -0
- data/lib/xmi/uml/uml_model.rb +6 -10
- data/lib/xmi/uml/upper_value.rb +13 -0
- data/lib/xmi/uml/usage.rb +18 -0
- data/lib/xmi/uml/value_specification.rb +46 -0
- data/lib/xmi/uml/waypoint.rb +23 -0
- data/lib/xmi/uml.rb +32 -6
- data/lib/xmi/version.rb +1 -1
- data/lib/xmi.rb +17 -3
- metadata +36 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
# UML 2.5 §9.8.2.4 — a literal null value specification. Carries
|
|
6
|
+
# no `value` attribute; presence of a LiteralNull child indicates
|
|
7
|
+
# the slot is explicitly null (vs. absent).
|
|
8
|
+
class LiteralNull < ValueSpecification
|
|
9
|
+
xml do
|
|
10
|
+
root "literalNull"
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
# UML 2.5 §9.8.2.5 — a literal string value specification.
|
|
6
|
+
class LiteralString < ValueSpecification
|
|
7
|
+
attribute :value, :string
|
|
8
|
+
|
|
9
|
+
xml do
|
|
10
|
+
root "literalString"
|
|
11
|
+
map_attribute "value", to: :value
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Xmi
|
|
4
|
+
module Uml
|
|
5
|
+
# UML 2.5 §9.8.2.8 — a literal unlimited-natural value
|
|
6
|
+
# specification. `value` is "*" for unbounded.
|
|
7
|
+
class LiteralUnlimitedNatural < ValueSpecification
|
|
8
|
+
attribute :value, :string
|
|
9
|
+
|
|
10
|
+
xml do
|
|
11
|
+
root "literalUnlimitedNatural"
|
|
12
|
+
map_attribute "value", to: :value
|
|
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
|
+
# UML `<opaqueExpression>` element — used as the body of a Slot's
|
|
6
|
+
# `<value>` element and as the language-bodied body of behavioral
|
|
7
|
+
# features. Sparx EA serialises instance-specification values as
|
|
8
|
+
# OpaqueExpression with a `body` attribute carrying the literal
|
|
9
|
+
# expression text.
|
|
10
|
+
#
|
|
11
|
+
# Per UML 2.5 §8.3, `body` and `language` are parallel arrays
|
|
12
|
+
# (`String [*]`): `body[i]` is written in `language[i]`. Most
|
|
13
|
+
# Sparx output carries a single pair; we model the collection
|
|
14
|
+
# form so multi-language expressions round-trip without loss.
|
|
15
|
+
class OpaqueExpression < ValueSpecification
|
|
16
|
+
attribute :body, :string, collection: true
|
|
17
|
+
attribute :language, :string, collection: true
|
|
18
|
+
attribute :body_attribute, :string
|
|
19
|
+
attribute :language_attribute, :string
|
|
20
|
+
|
|
21
|
+
xml do
|
|
22
|
+
root "opaqueExpression"
|
|
23
|
+
map_attribute "body", to: :body_attribute
|
|
24
|
+
map_attribute "language", to: :language_attribute
|
|
25
|
+
|
|
26
|
+
map_element "body", to: :body
|
|
27
|
+
map_element "language", to: :language
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
@@ -2,30 +2,45 @@
|
|
|
2
2
|
|
|
3
3
|
module Xmi
|
|
4
4
|
module Uml
|
|
5
|
-
class OwnedAttribute <
|
|
6
|
-
skip_reference_registration
|
|
7
|
-
attribute :type, ::Xmi::Type::XmiType
|
|
8
|
-
attribute :id, ::Xmi::Type::XmiId
|
|
5
|
+
class OwnedAttribute < Base
|
|
9
6
|
attribute :association, :string
|
|
10
7
|
attribute :name, :string
|
|
11
|
-
attribute :
|
|
8
|
+
attribute :visibility, :string
|
|
9
|
+
attribute :is_derived, :boolean
|
|
10
|
+
attribute :is_id, :boolean
|
|
11
|
+
attribute :is_ordered, :boolean
|
|
12
|
+
attribute :is_unique, :boolean
|
|
13
|
+
attribute :is_read_only, :boolean
|
|
14
|
+
# `default` is the XMI attribute form (string shortcut);
|
|
15
|
+
# `default_value` below is the child <defaultValue> element
|
|
16
|
+
# (ValueSpecification). UML 2.5 Property carries both shapes.
|
|
17
|
+
attribute :default, :string
|
|
18
|
+
attribute :aggregation, :string
|
|
12
19
|
attribute :uml_type, Uml::Type
|
|
13
|
-
attribute :upper_value,
|
|
14
|
-
attribute :lower_value,
|
|
20
|
+
attribute :upper_value, ValueSpecification, polymorphic: true
|
|
21
|
+
attribute :lower_value, ValueSpecification, polymorphic: true
|
|
22
|
+
attribute :default_value, ValueSpecification, polymorphic: true
|
|
15
23
|
|
|
16
24
|
xml do
|
|
17
25
|
root "ownedAttribute"
|
|
18
|
-
namespace ::Xmi::Namespace::Omg::Uml
|
|
19
|
-
|
|
20
|
-
map_attribute "type", to: :type
|
|
21
|
-
map_attribute "id", to: :id
|
|
22
26
|
map_attribute "association", to: :association
|
|
23
27
|
map_attribute "name", to: :name
|
|
28
|
+
map_attribute "visibility", to: :visibility
|
|
24
29
|
map_attribute "isDerived", to: :is_derived
|
|
30
|
+
map_attribute "isID", to: :is_id
|
|
31
|
+
map_attribute "isOrdered", to: :is_ordered
|
|
32
|
+
map_attribute "isUnique", to: :is_unique
|
|
33
|
+
map_attribute "isReadOnly", to: :is_read_only
|
|
34
|
+
map_attribute "default", to: :default
|
|
35
|
+
map_attribute "aggregation", to: :aggregation
|
|
25
36
|
|
|
26
37
|
map_element "type", to: :uml_type
|
|
27
|
-
map_element "upperValue", to: :upper_value
|
|
28
|
-
|
|
38
|
+
map_element "upperValue", to: :upper_value,
|
|
39
|
+
polymorphic: VALUE_SPECIFICATION_POLYMORPHIC_MAP
|
|
40
|
+
map_element "lowerValue", to: :lower_value,
|
|
41
|
+
polymorphic: VALUE_SPECIFICATION_POLYMORPHIC_MAP
|
|
42
|
+
map_element "defaultValue", to: :default_value,
|
|
43
|
+
polymorphic: VALUE_SPECIFICATION_POLYMORPHIC_MAP
|
|
29
44
|
end
|
|
30
45
|
end
|
|
31
46
|
end
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module Xmi
|
|
4
4
|
module Uml
|
|
5
|
-
class OwnedComment <
|
|
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
|
data/lib/xmi/uml/owned_end.rb
CHANGED
|
@@ -2,31 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
module Xmi
|
|
4
4
|
module Uml
|
|
5
|
-
class OwnedEnd <
|
|
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
|
|
8
|
+
attribute :visibility, :string
|
|
9
|
+
attribute :aggregation, :string
|
|
11
10
|
attribute :uml_type, Uml::Type
|
|
12
11
|
attribute :member_end, :string
|
|
13
|
-
attribute :
|
|
14
|
-
attribute :
|
|
12
|
+
attribute :upper_value, ValueSpecification, polymorphic: true
|
|
13
|
+
attribute :lower_value, ValueSpecification, polymorphic: true
|
|
14
|
+
attribute :default_value, ValueSpecification, polymorphic: true
|
|
15
15
|
attribute :is_composite, :boolean
|
|
16
16
|
|
|
17
17
|
xml do
|
|
18
18
|
root "ownedEnd"
|
|
19
|
-
namespace ::Xmi::Namespace::Omg::Uml
|
|
20
|
-
|
|
21
|
-
map_attribute "type", to: :type
|
|
22
|
-
map_attribute "id", to: :id
|
|
23
19
|
map_attribute "association", to: :association
|
|
24
20
|
map_attribute "name", to: :name
|
|
21
|
+
map_attribute "visibility", to: :visibility
|
|
22
|
+
map_attribute "aggregation", to: :aggregation
|
|
25
23
|
map_attribute "memberEnd", to: :member_end
|
|
26
|
-
map_attribute "lower", to: :lower
|
|
27
|
-
map_attribute "upper", to: :upper
|
|
28
24
|
map_attribute "isComposite", to: :is_composite
|
|
25
|
+
|
|
29
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
|
|
30
33
|
end
|
|
31
34
|
end
|
|
32
35
|
end
|
|
@@ -2,21 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
module Xmi
|
|
4
4
|
module Uml
|
|
5
|
-
class OwnedLiteral <
|
|
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 <
|
|
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 <
|
|
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 :
|
|
12
|
-
attribute :
|
|
13
|
-
attribute :
|
|
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
|
-
|
|
26
|
-
map_element "
|
|
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
|
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
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
|
data/lib/xmi/uml/precondition.rb
CHANGED
|
@@ -2,20 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
module Xmi
|
|
4
4
|
module Uml
|
|
5
|
-
class Precondition <
|
|
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
|
data/lib/xmi/uml/profile.rb
CHANGED
|
@@ -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
|
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
|