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.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop_todo.yml +31 -45
  3. data/README.adoc +0 -15
  4. data/lib/xmi/custom_profile/abstract.rb +16 -0
  5. data/lib/xmi/custom_profile/basic_doc.rb +16 -0
  6. data/lib/xmi/custom_profile/bibliography.rb +16 -0
  7. data/lib/xmi/custom_profile/edition.rb +18 -0
  8. data/lib/xmi/custom_profile/enumeration.rb +16 -0
  9. data/lib/xmi/custom_profile/informative.rb +16 -0
  10. data/lib/xmi/custom_profile/invariant.rb +16 -0
  11. data/lib/xmi/custom_profile/number.rb +18 -0
  12. data/lib/xmi/custom_profile/ocl.rb +16 -0
  13. data/lib/xmi/custom_profile/persistence.rb +20 -0
  14. data/lib/xmi/custom_profile/publication_date.rb +18 -0
  15. data/lib/xmi/custom_profile/year_version.rb +18 -0
  16. data/lib/xmi/custom_profile.rb +12 -143
  17. data/lib/xmi/ea_root/code_generation.rb +141 -0
  18. data/lib/xmi/ea_root/extension_lifecycle.rb +52 -0
  19. data/lib/xmi/ea_root/namespace_handling.rb +39 -0
  20. data/lib/xmi/ea_root/xml_parsing.rb +51 -0
  21. data/lib/xmi/ea_root.rb +16 -403
  22. data/lib/xmi/extension.rb +4 -12
  23. data/lib/xmi/parser_pipeline.rb +70 -0
  24. data/lib/xmi/root.rb +3 -12
  25. data/lib/xmi/sparx/connector/appearance.rb +27 -0
  26. data/lib/xmi/sparx/connector/connector.rb +52 -0
  27. data/lib/xmi/sparx/connector/end_base.rb +56 -0
  28. data/lib/xmi/sparx/connector/end_constraint.rb +33 -0
  29. data/lib/xmi/sparx/connector/end_modifiers.rb +19 -0
  30. data/lib/xmi/sparx/connector/end_role.rb +21 -0
  31. data/lib/xmi/sparx/connector/end_style.rb +17 -0
  32. data/lib/xmi/sparx/connector/end_type.rb +21 -0
  33. data/lib/xmi/sparx/connector/labels.rb +27 -0
  34. data/lib/xmi/sparx/connector/model.rb +19 -0
  35. data/lib/xmi/sparx/connector/properties.rb +19 -0
  36. data/lib/xmi/sparx/connector.rb +15 -233
  37. data/lib/xmi/sparx/element/association.rb +58 -0
  38. data/lib/xmi/sparx/element/attribute.rb +58 -0
  39. data/lib/xmi/sparx/element/bounds.rb +19 -0
  40. data/lib/xmi/sparx/element/code.rb +19 -0
  41. data/lib/xmi/sparx/element/containment.rb +19 -0
  42. data/lib/xmi/sparx/element/coords.rb +19 -0
  43. data/lib/xmi/sparx/element/documentation.rb +17 -0
  44. data/lib/xmi/sparx/element/element.rb +62 -0
  45. data/lib/xmi/sparx/element/extended_properties.rb +21 -0
  46. data/lib/xmi/sparx/element/flags.rb +29 -0
  47. data/lib/xmi/sparx/element/links.rb +22 -0
  48. data/lib/xmi/sparx/element/model.rb +26 -0
  49. data/lib/xmi/sparx/element/package_properties.rb +21 -0
  50. data/lib/xmi/sparx/element/paths.rb +17 -0
  51. data/lib/xmi/sparx/element/project.rb +29 -0
  52. data/lib/xmi/sparx/element/properties.rb +41 -0
  53. data/lib/xmi/sparx/element/stereotype.rb +17 -0
  54. data/lib/xmi/sparx/element/style.rb +17 -0
  55. data/lib/xmi/sparx/element/styleex.rb +17 -0
  56. data/lib/xmi/sparx/element/tag.rb +32 -0
  57. data/lib/xmi/sparx/element/times.rb +23 -0
  58. data/lib/xmi/sparx/element/xrefs.rb +17 -0
  59. data/lib/xmi/sparx/element.rb +28 -445
  60. data/lib/xmi/sparx/extension.rb +4 -12
  61. data/lib/xmi/sparx/gml/application_schema.rb +26 -0
  62. data/lib/xmi/sparx/gml/code_list.rb +23 -0
  63. data/lib/xmi/sparx/gml/data_type.rb +18 -0
  64. data/lib/xmi/sparx/gml/enumeration.rb +18 -0
  65. data/lib/xmi/sparx/gml/feature_type.rb +21 -0
  66. data/lib/xmi/sparx/gml/property.rb +24 -0
  67. data/lib/xmi/sparx/gml/shared_attributes.rb +39 -0
  68. data/lib/xmi/sparx/gml/type.rb +18 -0
  69. data/lib/xmi/sparx/gml/union.rb +18 -0
  70. data/lib/xmi/sparx/gml.rb +10 -125
  71. data/lib/xmi/sparx/index.rb +248 -0
  72. data/lib/xmi/sparx/mappings/base_mapping.rb +13 -137
  73. data/lib/xmi/sparx/root.rb +10 -11
  74. data/lib/xmi/sparx.rb +1 -0
  75. data/lib/xmi/uml/annotated_element.rb +16 -0
  76. data/lib/xmi/uml/association_generalization.rb +20 -0
  77. data/lib/xmi/uml/bounds.rb +43 -0
  78. data/lib/xmi/uml/default_value.rb +42 -0
  79. data/lib/xmi/uml/diagram.rb +25 -0
  80. data/lib/xmi/uml/member_end.rb +16 -0
  81. data/lib/xmi/uml/owned_attribute.rb +31 -0
  82. data/lib/xmi/uml/owned_comment.rb +29 -0
  83. data/lib/xmi/uml/owned_element.rb +33 -0
  84. data/lib/xmi/uml/owned_end.rb +34 -0
  85. data/lib/xmi/uml/owned_literal.rb +23 -0
  86. data/lib/xmi/uml/owned_operation.rb +22 -0
  87. data/lib/xmi/uml/owned_parameter.rb +29 -0
  88. data/lib/xmi/uml/package_import.rb +30 -0
  89. data/lib/xmi/uml/packaged_element.rb +49 -0
  90. data/lib/xmi/uml/precondition.rb +22 -0
  91. data/lib/xmi/uml/profile.rb +43 -0
  92. data/lib/xmi/uml/profile_application.rb +34 -0
  93. data/lib/xmi/uml/specification.rb +20 -0
  94. data/lib/xmi/uml/type.rb +18 -0
  95. data/lib/xmi/uml/uml_model.rb +29 -0
  96. data/lib/xmi/uml.rb +27 -502
  97. data/lib/xmi/version.rb +1 -1
  98. data/lib/xmi/xmi_identity.rb +46 -0
  99. data/lib/xmi.rb +11 -7
  100. metadata +84 -3
  101. data/lib/xmi/index.rb +0 -243
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Coords < Lutaml::Model::Serializable
7
+ attribute :ordered, :integer
8
+ attribute :scale, :integer
9
+
10
+ xml do
11
+ root "coords"
12
+
13
+ map_attribute "ordered", to: :ordered
14
+ map_attribute "scale", to: :scale
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Documentation < Lutaml::Model::Serializable
7
+ attribute :value, :string
8
+
9
+ xml do
10
+ root "documentation"
11
+
12
+ map_attribute "value", to: :value
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,62 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Element < Lutaml::Model::Serializable
7
+ attribute :idref, ::Xmi::Type::XmiIdRef
8
+ attribute :type, ::Xmi::Type::XmiType
9
+ attribute :name, :string
10
+ attribute :scope, :string
11
+ attribute :model, Model
12
+ attribute :properties, Properties
13
+ attribute :project, Project
14
+ attribute :code, Code
15
+ attribute :style, Style
16
+ attribute :tags, Tags
17
+ attribute :xrefs, Xrefs
18
+ attribute :extended_properties, ExtendedProperties
19
+ attribute :package_properties, PackageProperties
20
+ attribute :paths, Paths
21
+ attribute :times, Times
22
+ attribute :flags, Flags
23
+ attribute :links, Links, collection: true
24
+ attribute :attributes, Attributes
25
+
26
+ xml do
27
+ root "element"
28
+
29
+ map_attribute "idref", to: :idref
30
+ map_attribute "type", to: :type
31
+ map_attribute "name", to: :name
32
+ map_attribute "scope", to: :scope
33
+
34
+ map_element "model", to: :model
35
+ map_element "properties", to: :properties
36
+ map_element "project", to: :project
37
+ map_element "code", to: :code
38
+ map_element "style", to: :style
39
+ map_element "tags", to: :tags
40
+ map_element "xrefs", to: :xrefs
41
+ map_element "extendedProperties", to: :extended_properties
42
+ map_element "packageproperties", to: :package_properties
43
+ map_element "paths", to: :paths
44
+ map_element "times", to: :times
45
+ map_element "flags", to: :flags
46
+ map_element "links", to: :links
47
+ map_element "attributes", to: :attributes
48
+ end
49
+ end
50
+
51
+ class Elements < Lutaml::Model::Serializable
52
+ attribute :element, Element, collection: true
53
+
54
+ xml do
55
+ root "elements"
56
+
57
+ map_element "element", to: :element, value_map: VALUE_MAP
58
+ end
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class ExtendedProperties < Lutaml::Model::Serializable
7
+ attribute :tagged, :string
8
+ attribute :package_name, :string
9
+ attribute :virtual_inheritance, :integer
10
+
11
+ xml do
12
+ root "extendedProperties"
13
+
14
+ map_attribute "tagged", to: :tagged
15
+ map_attribute "package_name", to: :package_name
16
+ map_attribute "virtualInheritance", to: :virtual_inheritance
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Flags < Lutaml::Model::Serializable
7
+ attribute :is_controlled, :integer
8
+ attribute :is_protected, :integer
9
+ attribute :batch_save, :integer
10
+ attribute :batch_load, :integer
11
+ attribute :used_td, :integer
12
+ attribute :log_xml, :integer
13
+ attribute :package_flags, :string
14
+
15
+ xml do
16
+ root "flags"
17
+
18
+ map_attribute "iscontrolled", to: :is_controlled
19
+ map_attribute "isprotected", to: :is_protected
20
+ map_attribute "batchsave", to: :batch_save
21
+ map_attribute "batchload", to: :batch_load
22
+ map_attribute "usedtd", to: :used_td
23
+ map_attribute "logxml", to: :log_xml
24
+ map_attribute "packageFlags", to: :package_flags
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Links < Lutaml::Model::Serializable
7
+ attribute :association, Association, collection: true
8
+ attribute :generalization, Generalization, collection: true
9
+ attribute :note_link, NoteLink, collection: true
10
+
11
+ xml do
12
+ root "links"
13
+
14
+ map_element "Association", to: :association, value_map: VALUE_MAP
15
+ map_element "Generalization", to: :generalization,
16
+ value_map: VALUE_MAP
17
+ map_element "NoteLink", to: :note_link, value_map: VALUE_MAP
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Model < Lutaml::Model::Serializable
7
+ attribute :package, :string
8
+ attribute :package2, :string
9
+ attribute :tpos, :integer
10
+ attribute :ea_localid, :string
11
+ attribute :ea_eleType, :string
12
+
13
+ xml do
14
+ root "model"
15
+ namespace ::Xmi::Namespace::Omg::Uml
16
+
17
+ map_attribute "package", to: :package
18
+ map_attribute "package2", to: :package2
19
+ map_attribute "tpos", to: :tpos
20
+ map_attribute "ea_localid", to: :ea_localid
21
+ map_attribute "ea_eleType", to: :ea_eleType
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class PackageProperties < Lutaml::Model::Serializable
7
+ attribute :version, :string
8
+ attribute :xmiver, :string
9
+ attribute :tpos, :string
10
+
11
+ xml do
12
+ root "packagedproperties"
13
+
14
+ map_attribute "version", to: :version
15
+ map_attribute "xmiver", to: :xmiver
16
+ map_attribute "tpos", to: :tpos
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Paths < Lutaml::Model::Serializable
7
+ attribute :xmlpath, :string
8
+
9
+ xml do
10
+ root "paths"
11
+
12
+ map_attribute "xmlpath", to: :xmlpath
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Project < Lutaml::Model::Serializable
7
+ attribute :author, :string
8
+ attribute :version, :string
9
+ attribute :phase, :string
10
+ attribute :created, :string
11
+ attribute :modified, :string
12
+ attribute :complexity, :integer
13
+ attribute :status, :string
14
+
15
+ xml do
16
+ root "project"
17
+
18
+ map_attribute "author", to: :author
19
+ map_attribute "version", to: :version
20
+ map_attribute "phase", to: :phase
21
+ map_attribute "created", to: :created
22
+ map_attribute "modified", to: :modified
23
+ map_attribute "complexity", to: :complexity
24
+ map_attribute "status", to: :status
25
+ end
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Properties < Lutaml::Model::Serializable
7
+ attribute :name, :string
8
+ attribute :type, ::Xmi::Type::XmiType
9
+ attribute :is_specification, :boolean
10
+ attribute :is_root, :boolean
11
+ attribute :is_leaf, :boolean
12
+ attribute :is_abstract, :boolean
13
+ attribute :is_active, :boolean
14
+ attribute :s_type, :string
15
+ attribute :n_type, :string
16
+ attribute :scope, :string
17
+ attribute :stereotype, :string
18
+ attribute :alias, :string
19
+ attribute :documentation, :string
20
+
21
+ xml do
22
+ root "properties"
23
+
24
+ map_attribute "name", to: :name
25
+ map_attribute "type", to: :type
26
+ map_attribute "isSpecification", to: :is_specification
27
+ map_attribute "isRoot", to: :is_root
28
+ map_attribute "isLeaf", to: :is_leaf
29
+ map_attribute "isAbstract", to: :is_abstract
30
+ map_attribute "isActive", to: :is_active
31
+ map_attribute "sType", to: :s_type
32
+ map_attribute "nType", to: :n_type
33
+ map_attribute "scope", to: :scope
34
+ map_attribute "stereotype", to: :stereotype
35
+ map_attribute "alias", to: :alias
36
+ map_attribute "documentation", to: :documentation
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Stereotype < Lutaml::Model::Serializable
7
+ attribute :stereotype, :string
8
+
9
+ xml do
10
+ root "stereotype"
11
+
12
+ map_attribute "stereotype", to: :stereotype
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Style < Lutaml::Model::Serializable
7
+ attribute :appearance, :string
8
+
9
+ xml do
10
+ root "style"
11
+
12
+ map_attribute "appearance", to: :appearance
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Styleex < Lutaml::Model::Serializable
7
+ attribute :value, :string
8
+
9
+ xml do
10
+ root "styleex"
11
+
12
+ map_attribute "value", to: :value
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Tag < Lutaml::Model::Serializable
7
+ attribute :id, ::Xmi::Type::XmiId
8
+ attribute :name, :string
9
+ attribute :value, :string
10
+ attribute :model_element, :string
11
+
12
+ xml do
13
+ root "tag"
14
+
15
+ map_attribute "id", to: :id
16
+ map_attribute "name", to: :name
17
+ map_attribute "value", to: :value
18
+ map_attribute "modelElement", to: :model_element
19
+ end
20
+ end
21
+
22
+ class Tags < Lutaml::Model::Serializable
23
+ attribute :tags, Tag, collection: true
24
+
25
+ xml do
26
+ root "tags"
27
+ map_element "tag", to: :tags, value_map: VALUE_MAP
28
+ end
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Times < Lutaml::Model::Serializable
7
+ attribute :created, :string
8
+ attribute :modified, :string
9
+ attribute :last_load_date, :string
10
+ attribute :last_save_date, :string
11
+
12
+ xml do
13
+ root "times"
14
+
15
+ map_attribute "created", to: :created
16
+ map_attribute "modified", to: :modified
17
+ map_attribute "lastloaddate", to: :last_load_date
18
+ map_attribute "lastsavedate", to: :last_save_date
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Xmi
4
+ module Sparx
5
+ module Element
6
+ class Xrefs < Lutaml::Model::Serializable
7
+ attribute :value, :string
8
+
9
+ xml do
10
+ root "xrefs"
11
+
12
+ map_attribute "value", to: :value
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end