rgen 0.5.0 → 0.5.1
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.
- data/CHANGELOG +5 -0
- data/Rakefile +3 -3
- data/lib/rgen/metamodel_builder/builder_extensions.rb +6 -5
- data/lib/rgen/model_comparator_base.rb +137 -0
- data/test/metamodel_builder_test.rb +49 -1
- data/test/metamodel_roundtrip_test/TestModel_Regenerated.rb +34 -35
- data/test/metamodel_roundtrip_test/houseMetamodel_Regenerated.ecore +43 -42
- data/test/model_builder/builder_test.rb +2 -44
- data/test/model_builder/ecore_internal.rb +11 -11
- data/test/model_builder/serializer_test.rb +1 -0
- data/test/model_builder/statemachine_metamodel.rb +42 -0
- data/test/model_builder/test_model/statemachine1.rb +23 -0
- data/test/testmodel/ea_testmodel_regenerated.xml +584 -584
- metadata +21 -56
- data/lib/rgen/metamodel_builder/module_extension2.rb +0 -205
- data/test/ea_serializer_test/ea_testmodel_regenerated.xml +0 -821
- data/test/ea_serializer_test/ea_testmodel_regenerated_import.log +0 -3
- data/test/testmodel/ea_testmodel_import.log +0 -1
data/CHANGELOG
CHANGED
@@ -93,3 +93,8 @@
|
|
93
93
|
* Cleaned up EA support
|
94
94
|
* Added method to clear ecore metamodel reflection cache
|
95
95
|
* Improved overriding of metamodel features in reopened classes
|
96
|
+
|
97
|
+
=0.5.1 (Nov 10th, 2009)
|
98
|
+
|
99
|
+
* Fixed metamodel builder bug: _register at one-side did not unregister from the element referenced by the old value
|
100
|
+
* Added helper class for building simple model comparators
|
data/Rakefile
CHANGED
@@ -3,11 +3,11 @@ require 'rake/rdoctask'
|
|
3
3
|
|
4
4
|
RGenGemSpec = Gem::Specification.new do |s|
|
5
5
|
s.name = %q{rgen}
|
6
|
-
s.version = "0.5.
|
7
|
-
s.date = %q{2009-
|
6
|
+
s.version = "0.5.1"
|
7
|
+
s.date = %q{2009-11-10}
|
8
8
|
s.summary = %q{Ruby Modelling and Generator Framework}
|
9
9
|
s.email = %q{martin dot thiede at gmx de}
|
10
|
-
s.homepage = %q{ruby-gen.org}
|
10
|
+
s.homepage = %q{http://ruby-gen.org}
|
11
11
|
s.rubyforge_project = %q{rgen}
|
12
12
|
s.description = %q{RGen is a framework supporting Model Driven Software Development (MDSD). This means that it helps you build Metamodels, instantiate Models, modify and transform Models and finally generate arbitrary textual content from it.}
|
13
13
|
s.has_rdoc = true
|
@@ -270,7 +270,6 @@ module BuilderExtensions
|
|
270
270
|
def _build_one_methods(props, other_props=nil)
|
271
271
|
name = props.value(:name)
|
272
272
|
other_role = other_props && other_props.value(:name)
|
273
|
-
other_kind = other_props && ( other_props.many? ? :many : :one )
|
274
273
|
|
275
274
|
if props.value(:derived)
|
276
275
|
build_derived_method(name, props, :one)
|
@@ -301,7 +300,7 @@ module BuilderExtensions
|
|
301
300
|
<%= type_check_code("val", props) %>
|
302
301
|
oldval = @<%= name %>
|
303
302
|
@<%= name %> = val
|
304
|
-
<% if other_role
|
303
|
+
<% if other_role %>
|
305
304
|
oldval._unregister<%= firstToUpper(other_role) %>(self) unless oldval.nil?
|
306
305
|
val._register<%= firstToUpper(other_role) %>(self) unless val.nil?
|
307
306
|
<% end %>
|
@@ -309,6 +308,9 @@ module BuilderExtensions
|
|
309
308
|
alias set<%= firstToUpper(name) %> <%= name %>=
|
310
309
|
|
311
310
|
def _register<%= firstToUpper(name) %>(val)
|
311
|
+
<% if other_role %>
|
312
|
+
@<%= name %>._unregister<%= firstToUpper(other_role) %>(self) unless @<%= name %>.nil?
|
313
|
+
<% end %>
|
312
314
|
@<%= name %> = val
|
313
315
|
end
|
314
316
|
|
@@ -327,7 +329,6 @@ module BuilderExtensions
|
|
327
329
|
def _build_many_methods(props, other_props=nil)
|
328
330
|
name = props.value(:name)
|
329
331
|
other_role = other_props && other_props.value(:name)
|
330
|
-
other_kind = other_props && ( other_props.many? ? :many : :one )
|
331
332
|
|
332
333
|
if props.value(:derived)
|
333
334
|
build_derived_method(name, props, :many)
|
@@ -351,7 +352,7 @@ module BuilderExtensions
|
|
351
352
|
return if val.nil? || @<%= name %>.any?{|e| e.object_id == val.object_id}
|
352
353
|
<%= type_check_code("val", props) %>
|
353
354
|
@<%= name %>.push val
|
354
|
-
<% if other_role
|
355
|
+
<% if other_role %>
|
355
356
|
val._register<%= firstToUpper(other_role) %>(self)
|
356
357
|
<% end %>
|
357
358
|
end
|
@@ -361,7 +362,7 @@ module BuilderExtensions
|
|
361
362
|
@<%= name %>.each_with_index do |e,i|
|
362
363
|
if e.object_id == val.object_id
|
363
364
|
@<%= name %>.delete_at(i)
|
364
|
-
<% if other_role
|
365
|
+
<% if other_role %>
|
365
366
|
val._unregister<%= firstToUpper(other_role) %>(self)
|
366
367
|
<% end %>
|
367
368
|
return
|
@@ -0,0 +1,137 @@
|
|
1
|
+
require 'andand'
|
2
|
+
|
3
|
+
module RGen
|
4
|
+
|
5
|
+
class ModelComparatorBase
|
6
|
+
|
7
|
+
CompareSpec = Struct.new(:identifier, :recurse, :filter, :ignore_features, :display_name, :sort)
|
8
|
+
INDENT = " "
|
9
|
+
|
10
|
+
class << self
|
11
|
+
attr_reader :compareSpecs
|
12
|
+
|
13
|
+
def compare_spec(clazz, hash)
|
14
|
+
@compareSpecs ||= {}
|
15
|
+
raise "Compare spec already defined for #{clazz}" if @compareSpecs[clazz]
|
16
|
+
spec = CompareSpec.new
|
17
|
+
hash.each_pair do |k,v|
|
18
|
+
spec.send("#{k}=",v)
|
19
|
+
end
|
20
|
+
@compareSpecs[clazz] = spec
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# compares two sets of elements
|
25
|
+
def compare(as, bs, recursive=true)
|
26
|
+
result = []
|
27
|
+
aById = as.select{|e| useElement?(e)}.inject({}){|r, e| r[elementIdentifier(e)] = e; r}
|
28
|
+
bById = bs.select{|e| useElement?(e)}.inject({}){|r, e| r[elementIdentifier(e)] = e; r}
|
29
|
+
onlyA = sortElements((aById.keys - bById.keys).collect{|id| aById[id]})
|
30
|
+
onlyB = sortElements((bById.keys - aById.keys).collect{|id| bById[id]})
|
31
|
+
aAndB = sortElementPairs((aById.keys & bById.keys).collect{|id| [aById[id], bById[id]]})
|
32
|
+
onlyA.each do |e|
|
33
|
+
result << "- #{elementDisplayName(e)}"
|
34
|
+
end
|
35
|
+
onlyB.each do |e|
|
36
|
+
result << "+ #{elementDisplayName(e)}"
|
37
|
+
end
|
38
|
+
if recursive
|
39
|
+
aAndB.each do |ab|
|
40
|
+
a, b = *ab
|
41
|
+
r = compareElements(a, b)
|
42
|
+
if r.size > 0
|
43
|
+
result << "#{elementDisplayName(a)}"
|
44
|
+
result += r.collect{|l| INDENT+l}
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
result
|
49
|
+
end
|
50
|
+
|
51
|
+
def sortElementPairs(pairs)
|
52
|
+
pairs.sort do |x,y|
|
53
|
+
a, b = x[0], y[0]
|
54
|
+
r = a.class.name <=> b.class.name
|
55
|
+
r = compareSpec(a).sort.call(a,b) if r == 0 && compareSpec(a) && compareSpec(a).sort
|
56
|
+
r
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def sortElements(elements)
|
61
|
+
elements.sort do |a,b|
|
62
|
+
r = a.class.name <=> b.class.name
|
63
|
+
r = compareSpec(a).sort.call(a,b) if r == 0 && compareSpec(a) && compareSpec(a).sort
|
64
|
+
r
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
def elementDisplayName(e)
|
69
|
+
if compareSpec(e) && compareSpec(e).display_name
|
70
|
+
compareSpec(e).display_name.call(e)
|
71
|
+
else
|
72
|
+
elementIdentifier(e)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def compareElements(a, b)
|
77
|
+
result = []
|
78
|
+
if a.class != b.class
|
79
|
+
result << "Class: #{a.class} -> #{b.class}"
|
80
|
+
else
|
81
|
+
a.class.ecore.eAllStructuralFeatures.reject{|f| f.derived || compareSpec(a).andand.ignore_features.andand.include?(f.name.to_sym)}.each do |f|
|
82
|
+
va, vb = a.getGeneric(f.name), b.getGeneric(f.name)
|
83
|
+
if f.is_a?(RGen::ECore::EAttribute)
|
84
|
+
r = compareValues(f.name, va, vb)
|
85
|
+
result << r if r
|
86
|
+
else
|
87
|
+
va, vb = [va].compact, [vb].compact unless f.many
|
88
|
+
r = compare(va, vb, f.containment || compareSpec(a).andand.recurse.andand.include?(f.name.to_sym))
|
89
|
+
if r.size > 0
|
90
|
+
result << "[#{f.name}]"
|
91
|
+
result += r.collect{|l| INDENT+l}
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
result
|
97
|
+
end
|
98
|
+
|
99
|
+
def compareValues(name, val1, val2)
|
100
|
+
result = nil
|
101
|
+
result = "[#{name}] #{val1} -> #{val2}" if val1 != val2
|
102
|
+
result
|
103
|
+
end
|
104
|
+
|
105
|
+
def elementIdentifier(element)
|
106
|
+
cs = compareSpec(element)
|
107
|
+
if cs && cs.identifier
|
108
|
+
if cs.identifier.is_a?(Proc)
|
109
|
+
cs.identifier.call(element)
|
110
|
+
else
|
111
|
+
cs.identifier
|
112
|
+
end
|
113
|
+
else
|
114
|
+
if element.respond_to?(:name)
|
115
|
+
element.name
|
116
|
+
else
|
117
|
+
element.object_id
|
118
|
+
end
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
def useElement?(element)
|
123
|
+
cs = compareSpec(element)
|
124
|
+
!(cs && cs.filter) || cs.filter.call(element)
|
125
|
+
end
|
126
|
+
|
127
|
+
def compareSpec(element)
|
128
|
+
@compareSpec ||= {}
|
129
|
+
return @compareSpec[element.class] if @compareSpec[element.class]
|
130
|
+
return nil unless self.class.compareSpecs
|
131
|
+
key = self.class.compareSpecs.keys.find{|k| element.is_a?(k)}
|
132
|
+
@compareSpec[element.class] = self.class.compareSpecs[key]
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
@@ -189,6 +189,38 @@ class MetamodelBuilderTest < Test::Unit::TestCase
|
|
189
189
|
assert_equal [], ManyClass.ecore.eReferences.select{|r| r.many == true}
|
190
190
|
end
|
191
191
|
|
192
|
+
def test_one_to_many_replace1
|
193
|
+
oc1 = OneClass.new
|
194
|
+
oc2 = OneClass.new
|
195
|
+
mc = ManyClass.new
|
196
|
+
|
197
|
+
oc1.manyClasses = [mc]
|
198
|
+
assert_equal [mc], oc1.manyClasses
|
199
|
+
assert_equal [], oc2.manyClasses
|
200
|
+
assert_equal oc1, mc.oneClass
|
201
|
+
|
202
|
+
oc2.manyClasses = [mc]
|
203
|
+
assert_equal [mc], oc2.manyClasses
|
204
|
+
assert_equal [], oc1.manyClasses
|
205
|
+
assert_equal oc2, mc.oneClass
|
206
|
+
end
|
207
|
+
|
208
|
+
def test_one_to_many_replace2
|
209
|
+
oc = OneClass.new
|
210
|
+
mc1 = ManyClass.new
|
211
|
+
mc2 = ManyClass.new
|
212
|
+
|
213
|
+
mc1.oneClass = oc
|
214
|
+
assert_equal [mc1], oc.manyClasses
|
215
|
+
assert_equal oc, mc1.oneClass
|
216
|
+
assert_equal nil, mc2.oneClass
|
217
|
+
|
218
|
+
mc2.oneClass = oc
|
219
|
+
assert_equal [mc1, mc2], oc.manyClasses
|
220
|
+
assert_equal oc, mc1.oneClass
|
221
|
+
assert_equal oc, mc2.oneClass
|
222
|
+
end
|
223
|
+
|
192
224
|
class OneClass2 < RGen::MetamodelBuilder::MMBase
|
193
225
|
end
|
194
226
|
class ManyClass2 < RGen::MetamodelBuilder::MMBase
|
@@ -247,7 +279,7 @@ class MetamodelBuilderTest < Test::Unit::TestCase
|
|
247
279
|
assert_respond_to bc, :aClass
|
248
280
|
assert_respond_to bc, :aClass=
|
249
281
|
assert_nil bc.aClass
|
250
|
-
|
282
|
+
|
251
283
|
# put the AClass into the BClass
|
252
284
|
bc.aClass = ac
|
253
285
|
assert_equal ac, bc.aClass
|
@@ -274,6 +306,22 @@ class MetamodelBuilderTest < Test::Unit::TestCase
|
|
274
306
|
assert_equal [], BClassOO.ecore.eReferences.select{|r| r.many == true}
|
275
307
|
end
|
276
308
|
|
309
|
+
def test_one_to_one_replace
|
310
|
+
a = AClassOO.new
|
311
|
+
b1 = BClassOO.new
|
312
|
+
b2 = BClassOO.new
|
313
|
+
|
314
|
+
a.bClass = b1
|
315
|
+
assert_equal b1, a.bClass
|
316
|
+
assert_equal a, b1.aClass
|
317
|
+
assert_equal nil, b2.aClass
|
318
|
+
|
319
|
+
a.bClass = b2
|
320
|
+
assert_equal b2, a.bClass
|
321
|
+
assert_equal nil, b1.aClass
|
322
|
+
assert_equal a, b2.aClass
|
323
|
+
end
|
324
|
+
|
277
325
|
class AClassMM < RGen::MetamodelBuilder::MMBase
|
278
326
|
end
|
279
327
|
class BClassMM < RGen::MetamodelBuilder::MMBase
|
@@ -6,56 +6,55 @@ module HouseMetamodel
|
|
6
6
|
|
7
7
|
SexEnum = Enum.new(:name => 'SexEnum', :literals =>[ :male, :female ])
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
has_attr 'module', String
|
13
|
-
has_attr 'address', String, :changeable => false do
|
14
|
-
annotation 'collection' => 'false', 'containment' => 'Not Specified', 'derived' => '0', 'duplicates' => '0', 'ea_guid' => '{A8DF581B-9AC6-4f75-AB48-8FAEDFC6E068}', 'lowerBound' => '1', 'ordered' => '0', 'position' => '0', 'styleex' => 'volatile=0;', 'type' => 'String', 'upperBound' => '1'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
class Person < RGen::MetamodelBuilder::MMBase
|
19
|
-
annotation 'complexity' => '1', 'date_created' => '2006-06-27 08:34:23', 'date_modified' => '2006-06-27 08:34:26', 'ea_ntype' => '0', 'ea_stype' => 'Class', 'gentype' => 'Java', 'isSpecification' => 'false', 'package' => 'EAPK_A1B83D59_CAE1_422c_BA5F_D3624D7156AD', 'package_name' => 'HouseMetamodel', 'phase' => '1.0', 'status' => 'Proposed', 'style' => 'BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=0;HSwimLanes=0;BorderStyle=0;', 'tagged' => '0', 'version' => '1.0'
|
20
|
-
has_attr 'sex', HouseMetamodel::SexEnum
|
21
|
-
end
|
9
|
+
module Rooms
|
10
|
+
extend RGen::MetamodelBuilder::ModuleExtension
|
11
|
+
include RGen::MetamodelBuilder::DataTypes
|
22
12
|
|
23
|
-
class MeetingPlace < RGen::MetamodelBuilder::MMBase
|
24
|
-
annotation :source => "testmodel", :details => {'complexity' => '1', 'date_created' => '2006-07-12 08:40:46', 'date_modified' => '2006-07-12 08:44:02', 'ea_ntype' => '0', 'ea_stype' => 'Class', 'gentype' => 'Java', 'isSpecification' => 'false', 'package' => 'EAPK_A1B83D59_CAE1_422c_BA5F_D3624D7156AD', 'package_name' => 'HouseMetamodel', 'phase' => '1.0', 'status' => 'Proposed', 'style' => 'BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=0;HSwimLanes=0;BorderStyle=0;', 'tagged' => '0', 'version' => '1.0'}
|
25
13
|
end
|
26
14
|
|
27
|
-
|
28
|
-
module Rooms
|
15
|
+
module DependingOnRooms
|
29
16
|
extend RGen::MetamodelBuilder::ModuleExtension
|
30
17
|
include RGen::MetamodelBuilder::DataTypes
|
31
18
|
|
19
|
+
end
|
20
|
+
end
|
32
21
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
22
|
+
class HouseMetamodel::House < RGen::MetamodelBuilder::MMBase
|
23
|
+
annotation 'complexity' => '1', 'date_created' => '2005-09-16 19:52:18', 'date_modified' => '2006-02-28 08:29:19', 'ea_ntype' => '0', 'ea_stype' => 'Class', 'gentype' => 'Java', 'isSpecification' => 'false', 'package' => 'EAPK_A1B83D59_CAE1_422c_BA5F_D3624D7156AD', 'package_name' => 'HouseMetamodel', 'phase' => '1.0', 'status' => 'Proposed', 'stereotype' => 'dummy', 'style' => 'BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=0;HSwimLanes=0;BorderStyle=0;', 'tagged' => '0', 'version' => '1.0'
|
24
|
+
has_attr 'size', Integer
|
25
|
+
has_attr 'module', String
|
26
|
+
has_attr 'address', String, :changeable => false do
|
27
|
+
annotation 'collection' => 'false', 'containment' => 'Not Specified', 'derived' => '0', 'duplicates' => '0', 'ea_guid' => '{A8DF581B-9AC6-4f75-AB48-8FAEDFC6E068}', 'lowerBound' => '1', 'ordered' => '0', 'position' => '0', 'styleex' => 'volatile=0;', 'type' => 'String', 'upperBound' => '1'
|
28
|
+
end
|
29
|
+
end
|
41
30
|
|
42
|
-
|
43
|
-
|
44
|
-
|
31
|
+
class HouseMetamodel::Person < RGen::MetamodelBuilder::MMBase
|
32
|
+
annotation 'complexity' => '1', 'date_created' => '2006-06-27 08:34:23', 'date_modified' => '2006-06-27 08:34:26', 'ea_ntype' => '0', 'ea_stype' => 'Class', 'gentype' => 'Java', 'isSpecification' => 'false', 'package' => 'EAPK_A1B83D59_CAE1_422c_BA5F_D3624D7156AD', 'package_name' => 'HouseMetamodel', 'phase' => '1.0', 'status' => 'Proposed', 'style' => 'BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=0;HSwimLanes=0;BorderStyle=0;', 'tagged' => '0', 'version' => '1.0'
|
33
|
+
has_attr 'sex', HouseMetamodel::SexEnum
|
34
|
+
has_many_attr 'nicknames', String
|
35
|
+
end
|
45
36
|
|
46
|
-
|
37
|
+
class HouseMetamodel::MeetingPlace < RGen::MetamodelBuilder::MMBase
|
38
|
+
annotation :source => "testmodel", :details => {'complexity' => '1', 'date_created' => '2006-07-12 08:40:46', 'date_modified' => '2006-07-12 08:44:02', 'ea_ntype' => '0', 'ea_stype' => 'Class', 'gentype' => 'Java', 'isSpecification' => 'false', 'package' => 'EAPK_A1B83D59_CAE1_422c_BA5F_D3624D7156AD', 'package_name' => 'HouseMetamodel', 'phase' => '1.0', 'status' => 'Proposed', 'style' => 'BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=0;HSwimLanes=0;BorderStyle=0;', 'tagged' => '0', 'version' => '1.0'}
|
39
|
+
end
|
47
40
|
|
48
|
-
|
49
|
-
|
50
|
-
|
41
|
+
class HouseMetamodel::Rooms::Room < RGen::MetamodelBuilder::MMBase
|
42
|
+
abstract
|
43
|
+
annotation 'complexity' => '1', 'date_created' => '2005-09-16 19:52:28', 'date_modified' => '2006-06-22 21:15:25', 'ea_ntype' => '0', 'ea_stype' => 'Class', 'gentype' => 'Java', 'isSpecification' => 'false', 'package' => 'EAPK_F9D8C6E3_4DAD_4aa2_AD47_D0ABA4E93E08', 'package_name' => 'Rooms', 'phase' => '1.0', 'status' => 'Proposed', 'style' => 'BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=0;HSwimLanes=0;BorderStyle=0;', 'tagged' => '0', 'version' => '1.0'
|
44
|
+
end
|
51
45
|
|
46
|
+
class HouseMetamodel::Rooms::Bathroom < HouseMetamodel::Rooms::Room
|
47
|
+
annotation 'complexity' => '1', 'date_created' => '2006-06-27 08:32:25', 'date_modified' => '2006-06-27 08:34:23', 'ea_ntype' => '0', 'ea_stype' => 'Class', 'gentype' => 'Java', 'isSpecification' => 'false', 'package' => 'EAPK_F9D8C6E3_4DAD_4aa2_AD47_D0ABA4E93E08', 'package_name' => 'Rooms', 'phase' => '1.0', 'status' => 'Proposed', 'style' => 'BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=0;HSwimLanes=0;BorderStyle=0;', 'tagged' => '0', 'version' => '1.0'
|
48
|
+
end
|
52
49
|
|
53
|
-
|
54
|
-
|
50
|
+
class HouseMetamodel::Rooms::Kitchen < RGen::MetamodelBuilder::MMMultiple(HouseMetamodel::MeetingPlace, HouseMetamodel::Rooms::Room)
|
51
|
+
annotation 'complexity' => '1', 'date_created' => '2005-11-30 19:26:13', 'date_modified' => '2006-06-22 21:15:34', 'ea_ntype' => '0', 'ea_stype' => 'Class', 'gentype' => 'Java', 'isSpecification' => 'false', 'package' => 'EAPK_F9D8C6E3_4DAD_4aa2_AD47_D0ABA4E93E08', 'package_name' => 'Rooms', 'phase' => '1.0', 'status' => 'Proposed', 'style' => 'BackColor=-1;BorderColor=-1;BorderWidth=-1;FontColor=-1;VSwimLanes=0;HSwimLanes=0;BorderStyle=0;', 'tagged' => '0', 'version' => '1.0'
|
52
|
+
end
|
55
53
|
|
56
|
-
|
54
|
+
class HouseMetamodel::DependingOnRooms::RoomSub < HouseMetamodel::Rooms::Room
|
57
55
|
end
|
58
56
|
|
57
|
+
|
59
58
|
HouseMetamodel::House.has_one 'bathroom', HouseMetamodel::Rooms::Bathroom, :transient => true, :lowerBound => 1
|
60
59
|
HouseMetamodel::House.one_to_one 'kitchen', HouseMetamodel::Rooms::Kitchen, 'house', :lowerBound => 1, :opposite_lowerBound => 1 do
|
61
60
|
annotation 'containment' => 'Unspecified'
|
@@ -1,9 +1,9 @@
|
|
1
1
|
<ecore:EPackage xmi:version="2.0" name="HouseMetamodel" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore">
|
2
|
-
<eClassifiers name="House" abstract="false" instanceClassName="HouseMetamodel::House" interface="false"
|
3
|
-
<eStructuralFeatures name="size" derived="false" transient="false" changeable="true"
|
4
|
-
<eStructuralFeatures name="module" derived="false" transient="false" changeable="true"
|
5
|
-
<eStructuralFeatures name="address" derived="false" transient="false" changeable="false"
|
6
|
-
<eAnnotations
|
2
|
+
<eClassifiers name="House" abstract="false" instanceClassName="HouseMetamodel::House" interface="false" xsi:type="ecore:EClass">
|
3
|
+
<eStructuralFeatures name="size" derived="false" transient="false" changeable="true" unsettable="false" iD="false" xsi:type="ecore:EAttribute" upperBound="1" ordered="true" volatile="false" lowerBound="0" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" unique="true"/>
|
4
|
+
<eStructuralFeatures name="module" derived="false" transient="false" changeable="true" unsettable="false" iD="false" xsi:type="ecore:EAttribute" upperBound="1" ordered="true" volatile="false" lowerBound="0" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" unique="true"/>
|
5
|
+
<eStructuralFeatures name="address" derived="false" transient="false" changeable="false" unsettable="false" iD="false" xsi:type="ecore:EAttribute" upperBound="1" ordered="true" volatile="false" lowerBound="0" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" unique="true">
|
6
|
+
<eAnnotations xsi:type="ecore:EAnnotation">
|
7
7
|
<details xsi:type="ecore:EStringToStringMapEntry" value="0" key="derived"/>
|
8
8
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Not Specified" key="containment"/>
|
9
9
|
<details xsi:type="ecore:EStringToStringMapEntry" value="{A8DF581B-9AC6-4f75-AB48-8FAEDFC6E068}" key="ea_guid"/>
|
@@ -17,14 +17,14 @@
|
|
17
17
|
<details xsi:type="ecore:EStringToStringMapEntry" value="0" key="position"/>
|
18
18
|
</eAnnotations>
|
19
19
|
</eStructuralFeatures>
|
20
|
-
<eStructuralFeatures name="bathroom" derived="false" containment="false" transient="true" changeable="true" resolveProxies="true"
|
21
|
-
<eStructuralFeatures name="kitchen" derived="false" containment="false" transient="false" changeable="true" resolveProxies="true"
|
22
|
-
<eAnnotations
|
20
|
+
<eStructuralFeatures name="bathroom" derived="false" containment="false" transient="true" changeable="true" resolveProxies="true" unsettable="false" xsi:type="ecore:EReference" upperBound="1" ordered="true" volatile="false" lowerBound="1" eType="#//Rooms/Bathroom" unique="true"/>
|
21
|
+
<eStructuralFeatures name="kitchen" derived="false" containment="false" transient="false" changeable="true" resolveProxies="true" eOpposite="#//Rooms/Kitchen/house" unsettable="false" xsi:type="ecore:EReference" upperBound="1" ordered="true" volatile="false" lowerBound="1" eType="#//Rooms/Kitchen" unique="true">
|
22
|
+
<eAnnotations xsi:type="ecore:EAnnotation">
|
23
23
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Unspecified" key="containment"/>
|
24
24
|
</eAnnotations>
|
25
25
|
</eStructuralFeatures>
|
26
|
-
<eStructuralFeatures name="room" derived="false" containment="true" transient="false" changeable="true" resolveProxies="true"
|
27
|
-
<eAnnotations
|
26
|
+
<eStructuralFeatures name="room" derived="false" containment="true" transient="false" changeable="true" resolveProxies="true" eOpposite="#//Rooms/Room/house" unsettable="false" xsi:type="ecore:EReference" upperBound="-1" ordered="true" volatile="false" lowerBound="1" eType="#//Rooms/Room" unique="true"/>
|
27
|
+
<eAnnotations xsi:type="ecore:EAnnotation">
|
28
28
|
<details xsi:type="ecore:EStringToStringMapEntry" value="dummy" key="stereotype"/>
|
29
29
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Proposed" key="status"/>
|
30
30
|
<details xsi:type="ecore:EStringToStringMapEntry" value="2005-09-16 19:52:18" key="date_created"/>
|
@@ -42,14 +42,15 @@
|
|
42
42
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Java" key="gentype"/>
|
43
43
|
</eAnnotations>
|
44
44
|
</eClassifiers>
|
45
|
-
<eClassifiers name="Person" abstract="false" instanceClassName="HouseMetamodel::Person" interface="false"
|
46
|
-
<eStructuralFeatures name="sex" derived="false" transient="false" changeable="true"
|
47
|
-
<eStructuralFeatures name="
|
48
|
-
|
45
|
+
<eClassifiers name="Person" abstract="false" instanceClassName="HouseMetamodel::Person" interface="false" xsi:type="ecore:EClass">
|
46
|
+
<eStructuralFeatures name="sex" derived="false" transient="false" changeable="true" unsettable="false" iD="false" xsi:type="ecore:EAttribute" upperBound="1" ordered="true" volatile="false" lowerBound="0" eType="#//SexEnum" unique="true"/>
|
47
|
+
<eStructuralFeatures name="nicknames" derived="false" transient="false" changeable="true" unsettable="false" iD="false" xsi:type="ecore:EAttribute" upperBound="-1" ordered="true" volatile="false" lowerBound="0" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString" unique="true"/>
|
48
|
+
<eStructuralFeatures name="home" derived="false" containment="false" transient="false" changeable="true" resolveProxies="true" unsettable="false" xsi:type="ecore:EReference" upperBound="-1" ordered="true" volatile="false" lowerBound="0" eType="#//House" unique="true">
|
49
|
+
<eAnnotations xsi:type="ecore:EAnnotation">
|
49
50
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Unspecified" key="containment"/>
|
50
51
|
</eAnnotations>
|
51
52
|
</eStructuralFeatures>
|
52
|
-
<eAnnotations
|
53
|
+
<eAnnotations xsi:type="ecore:EAnnotation">
|
53
54
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Proposed" key="status"/>
|
54
55
|
<details xsi:type="ecore:EStringToStringMapEntry" value="2006-06-27 08:34:23" key="date_created"/>
|
55
56
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Class" key="ea_stype"/>
|
@@ -66,12 +67,12 @@
|
|
66
67
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Java" key="gentype"/>
|
67
68
|
</eAnnotations>
|
68
69
|
</eClassifiers>
|
69
|
-
<eClassifiers name="SexEnum" instanceClassName="HouseMetamodel::SexEnum"
|
70
|
-
<eLiterals name="male" xsi:type="ecore:EEnumLiteral"
|
71
|
-
<eLiterals name="female" xsi:type="ecore:EEnumLiteral"
|
70
|
+
<eClassifiers name="SexEnum" instanceClassName="HouseMetamodel::SexEnum" xsi:type="ecore:EEnum">
|
71
|
+
<eLiterals name="male" xsi:type="ecore:EEnumLiteral"/>
|
72
|
+
<eLiterals name="female" xsi:type="ecore:EEnumLiteral"/>
|
72
73
|
</eClassifiers>
|
73
|
-
<eClassifiers name="MeetingPlace" abstract="false" instanceClassName="HouseMetamodel::MeetingPlace" interface="false"
|
74
|
-
<eAnnotations
|
74
|
+
<eClassifiers name="MeetingPlace" abstract="false" instanceClassName="HouseMetamodel::MeetingPlace" interface="false" xsi:type="ecore:EClass" eSubTypes="#//Rooms/Kitchen">
|
75
|
+
<eAnnotations xsi:type="ecore:EAnnotation" source="testmodel">
|
75
76
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Proposed" key="status"/>
|
76
77
|
<details xsi:type="ecore:EStringToStringMapEntry" value="2006-07-12 08:40:46" key="date_created"/>
|
77
78
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Class" key="ea_stype"/>
|
@@ -88,18 +89,13 @@
|
|
88
89
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Java" key="gentype"/>
|
89
90
|
</eAnnotations>
|
90
91
|
</eClassifiers>
|
91
|
-
<eSubpackages name="Rooms" xsi:type="ecore:EPackage"
|
92
|
-
<eClassifiers name="
|
93
|
-
<
|
94
|
-
<eAnnotations eModelElement="#//Rooms/Room/house" xsi:type="ecore:EAnnotation">
|
95
|
-
<details xsi:type="ecore:EStringToStringMapEntry" value="Unspecified" key="containment"/>
|
96
|
-
</eAnnotations>
|
97
|
-
</eStructuralFeatures>
|
98
|
-
<eAnnotations eModelElement="#//Rooms/Room" xsi:type="ecore:EAnnotation">
|
92
|
+
<eSubpackages name="Rooms" xsi:type="ecore:EPackage">
|
93
|
+
<eClassifiers name="Bathroom" abstract="false" instanceClassName="HouseMetamodel::Rooms::Bathroom" interface="false" xsi:type="ecore:EClass" eSuperTypes="#//Rooms/Room">
|
94
|
+
<eAnnotations xsi:type="ecore:EAnnotation">
|
99
95
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Proposed" key="status"/>
|
100
|
-
<details xsi:type="ecore:EStringToStringMapEntry" value="
|
96
|
+
<details xsi:type="ecore:EStringToStringMapEntry" value="2006-06-27 08:32:25" key="date_created"/>
|
101
97
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Class" key="ea_stype"/>
|
102
|
-
<details xsi:type="ecore:EStringToStringMapEntry" value="2006-06-
|
98
|
+
<details xsi:type="ecore:EStringToStringMapEntry" value="2006-06-27 08:34:23" key="date_modified"/>
|
103
99
|
<details xsi:type="ecore:EStringToStringMapEntry" value="0" key="tagged"/>
|
104
100
|
<details xsi:type="ecore:EStringToStringMapEntry" value="0" key="ea_ntype"/>
|
105
101
|
<details xsi:type="ecore:EStringToStringMapEntry" value="1.0" key="version"/>
|
@@ -112,17 +108,17 @@
|
|
112
108
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Java" key="gentype"/>
|
113
109
|
</eAnnotations>
|
114
110
|
</eClassifiers>
|
115
|
-
<eClassifiers name="
|
116
|
-
<eStructuralFeatures name="house" derived="false" containment="false" transient="false" changeable="true" resolveProxies="true"
|
117
|
-
<eAnnotations
|
111
|
+
<eClassifiers name="Room" abstract="true" instanceClassName="HouseMetamodel::Rooms::Room" interface="false" xsi:type="ecore:EClass" eSubTypes="#//Rooms/Bathroom #//Rooms/Kitchen #//DependingOnRooms/RoomSub">
|
112
|
+
<eStructuralFeatures name="house" derived="false" containment="false" transient="false" changeable="true" resolveProxies="true" eOpposite="#//House/room" unsettable="false" xsi:type="ecore:EReference" upperBound="1" ordered="true" volatile="false" lowerBound="0" eType="#//House" unique="true">
|
113
|
+
<eAnnotations xsi:type="ecore:EAnnotation">
|
118
114
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Unspecified" key="containment"/>
|
119
115
|
</eAnnotations>
|
120
116
|
</eStructuralFeatures>
|
121
|
-
<eAnnotations
|
117
|
+
<eAnnotations xsi:type="ecore:EAnnotation">
|
122
118
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Proposed" key="status"/>
|
123
|
-
<details xsi:type="ecore:EStringToStringMapEntry" value="2005-
|
119
|
+
<details xsi:type="ecore:EStringToStringMapEntry" value="2005-09-16 19:52:28" key="date_created"/>
|
124
120
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Class" key="ea_stype"/>
|
125
|
-
<details xsi:type="ecore:EStringToStringMapEntry" value="2006-06-22 21:15:
|
121
|
+
<details xsi:type="ecore:EStringToStringMapEntry" value="2006-06-22 21:15:25" key="date_modified"/>
|
126
122
|
<details xsi:type="ecore:EStringToStringMapEntry" value="0" key="tagged"/>
|
127
123
|
<details xsi:type="ecore:EStringToStringMapEntry" value="0" key="ea_ntype"/>
|
128
124
|
<details xsi:type="ecore:EStringToStringMapEntry" value="1.0" key="version"/>
|
@@ -135,12 +131,17 @@
|
|
135
131
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Java" key="gentype"/>
|
136
132
|
</eAnnotations>
|
137
133
|
</eClassifiers>
|
138
|
-
<eClassifiers name="
|
139
|
-
<
|
134
|
+
<eClassifiers name="Kitchen" abstract="false" instanceClassName="HouseMetamodel::Rooms::Kitchen" interface="false" xsi:type="ecore:EClass" eSuperTypes="#//MeetingPlace #//Rooms/Room">
|
135
|
+
<eStructuralFeatures name="house" derived="false" containment="false" transient="false" changeable="true" resolveProxies="true" eOpposite="#//House/kitchen" unsettable="false" xsi:type="ecore:EReference" upperBound="1" ordered="true" volatile="false" lowerBound="1" eType="#//House" unique="true">
|
136
|
+
<eAnnotations xsi:type="ecore:EAnnotation">
|
137
|
+
<details xsi:type="ecore:EStringToStringMapEntry" value="Unspecified" key="containment"/>
|
138
|
+
</eAnnotations>
|
139
|
+
</eStructuralFeatures>
|
140
|
+
<eAnnotations xsi:type="ecore:EAnnotation">
|
140
141
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Proposed" key="status"/>
|
141
|
-
<details xsi:type="ecore:EStringToStringMapEntry" value="
|
142
|
+
<details xsi:type="ecore:EStringToStringMapEntry" value="2005-11-30 19:26:13" key="date_created"/>
|
142
143
|
<details xsi:type="ecore:EStringToStringMapEntry" value="Class" key="ea_stype"/>
|
143
|
-
<details xsi:type="ecore:EStringToStringMapEntry" value="2006-06-
|
144
|
+
<details xsi:type="ecore:EStringToStringMapEntry" value="2006-06-22 21:15:34" key="date_modified"/>
|
144
145
|
<details xsi:type="ecore:EStringToStringMapEntry" value="0" key="tagged"/>
|
145
146
|
<details xsi:type="ecore:EStringToStringMapEntry" value="0" key="ea_ntype"/>
|
146
147
|
<details xsi:type="ecore:EStringToStringMapEntry" value="1.0" key="version"/>
|
@@ -154,7 +155,7 @@
|
|
154
155
|
</eAnnotations>
|
155
156
|
</eClassifiers>
|
156
157
|
</eSubpackages>
|
157
|
-
<eSubpackages name="DependingOnRooms" xsi:type="ecore:EPackage"
|
158
|
-
<eClassifiers name="RoomSub" abstract="false" instanceClassName="HouseMetamodel::DependingOnRooms::RoomSub" interface="false"
|
158
|
+
<eSubpackages name="DependingOnRooms" xsi:type="ecore:EPackage">
|
159
|
+
<eClassifiers name="RoomSub" abstract="false" instanceClassName="HouseMetamodel::DependingOnRooms::RoomSub" interface="false" xsi:type="ecore:EClass" eSuperTypes="#//Rooms/Room"/>
|
159
160
|
</eSubpackages>
|
160
161
|
</ecore:EPackage>
|