File: simple_xmi_metamodel.rb

package info (click to toggle)
ruby-rgen 0.10.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 2,428 kB
  • sloc: ruby: 11,344; xml: 1,368; yacc: 72; makefile: 10
file content (49 lines) | stat: -rw-r--r-- 1,140 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# This is an extension of the implicit metamodel created by the
# DefaultXMLInstantiator when it reads an Enterprise Architect
# XMI file.
# 
module SimpleXMIMetaModel
  
  module UML
    include RGen::MetamodelBuilder

    class Classifier_feature < MMBase
    end

    class ClassifierRole < MMBase
    end

    class Clazz < ClassifierRole
    end

    class Interface < ClassifierRole
    end

    class Operation < MMBase
    end

    class Generalization < MMBase
    end

    class ModelElement_stereotype < MMBase
    end

    class AssociationEnd < MMBase
      module ClassModule
        def otherEnd
          parent.associationEnd.find{|ae| ae != self}
        end
      end
    end

    class AssociationEndRole < MMBase
    end

    ClassifierRole.one_to_many 'associationEnds', AssociationEnd, 'typeClass'
    ClassifierRole.one_to_many 'associationEndRoles', AssociationEndRole, 'typeClass'
    Clazz.one_to_many 'generalizationsAsSubtype', Generalization, 'subtypeClass'
    Clazz.one_to_many 'generalizationsAsSupertype', Generalization, 'supertypeClass'
    
  end
  
end