package SQL::Translator::XMI::Parser::V12;
# -------------------------------------------------------------------
-# $Id: V12.pm,v 1.1 2003-09-29 12:02:36 grommit Exp $
+# $Id$
# -------------------------------------------------------------------
# Copyright (C) 2003 Mark Addison <mark.addison@itn.co.uk>,
#
use strict;
use 5.006_001;
use vars qw/$VERSION/;
-$VERSION = sprintf "%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision$ =~ /(\d+)\.(\d+)/;
use base qw(SQL::Translator::XMI::Parser);
my $spec12 = {};
+$spec12->{taggedValue} = {
+ name => "taggedValue",
+ plural => "taggedValues",
+ default_path => '//UML:TaggedValue[@xmi.id]',
+ attrib_data => [qw/isSpecification/],
+ path_data => [
+ {
+ name => "dataValue",
+ path => 'UML:TaggedValue.dataValue/text()',
+ },
+ {
+ name => "name",
+ path => 'xmiDeref(UML:TaggedValue.type/UML:TagDefinition)/@name',
+ },
+ ],
+};
+
$spec12->{class} = {
name => "class",
plural => "classes",
],
};
-$spec12->{taggedValue} = {
- name => "taggedValue",
- plural => "taggedValues",
- default_path => '//UML:TaggedValue[@xmi.id]',
- attrib_data => [qw/isSpecification/],
- path_data => [
- {
- name => "dataValue",
- path => 'UML:TaggedValue.dataValue/text()',
- },
- {
- name => "name",
- path => 'xmiDeref(UML:TaggedValue.type/UML:TagDefinition)/@name',
- },
- ],
-};
-
$spec12->{attribute} = {
name => "attribute",
plural => "attributes",
default => "",
},
{
- name => "datatype",
- path => 'xmiDeref(UML:StructuralFeature.type/UML:DataType)/@name',
- },
- {
name => "initialValue",
path => 'UML:Attribute.initialValue/UML:Expression/@body',
},
multiplicity => "*",
map => "name",
},
+ {
+ name => "dataType",
+ path => 'xmiDeref(UML:StructuralFeature.type/UML:DataType)',
+ class => "dataType",
+ multiplicity => "1",
+ },
],
};
+$spec12->{dataType} = {
+ name => "datatype",
+ plural => "datatypes",
+ isRoot => 1,
+ default_path => '//UML:DataType[@xmi.id]',
+ attrib_data =>
+ [qw/name visibility isSpecification isRoot isLeaf isAbstract/],
+ path_data => [
+ {
+ name => "stereotype",
+ path => 'xmiDeref(UML:ModelElement.stereotype/UML:Stereotype)/@name',
+ default => "",
+ },
+ ],
+ kids => [
+ {
+ name => "taggedValues",
+ path => 'UML:ModelElement.taggedValue/UML:TaggedValue',
+ class => "taggedValue",
+ multiplicity => "*",
+ map => "name",
+ },
+ ],
+};
+
+
+
$spec12->{operation} = {
name => "operation",
plural => "operations",
],
kids => [
{
- name => "ends",
+ name => "associationEnds",
path => "UML:Association.connection/UML:AssociationEnd",
class => "AssociationEnd",
multiplicity => "*",
},
],
kids => [
+ {
+ name => "association",
+ path => "../..",
+ class => "association",
+ multiplicity => "1",
+ },
{
name => "participant",
path => "xmiDeref(UML:AssociationEnd.participant/UML:Class)",
multiplicity => "1",
},
{
- name => "association",
- path => "../..",
- class => "association",
+ name => "multiplicity",
+ #path => "xmiDeref(UML:AssociationEnd.multiplicity/UML:Multiplicity)",
+ path => 'UML:AssociationEnd.multiplicity/UML:Multiplicity',
+ class => "multiplicity",
multiplicity => "1",
},
],
};
+$spec12->{multiplicity} = {
+ name => "multiplicity",
+ plural => "multiplicities",
+ default_path => '//UML:Multiplicity[@xmi.id]',
+ attrib_data => [qw//],
+ path_data => [
+ {
+ name => "rangeLower",
+ path => 'xmiDeref(UML:Multiplicity.range/UML:MultiplicityRange)/@lower',
+ },
+ {
+ name => "rangeUpper",
+ path => 'xmiDeref(UML:Multiplicity.range/UML:MultiplicityRange)/@upper',
+ },
+ ],
+};
+
# Set the spec and have the get_* methods generated
__PACKAGE__->XmiSpec($spec12);
-#-----------------------------------------------------------------------------
-
-# Test override
-# sub get_classes {
-# print "HELLO 1.2\n";
-# shift->SUPER::get_classes(@_);
-# }
1; #===========================================================================