コード例 #1
0
         'datatypedependentgenerator',
         'class', order=10)
@handler('anchorassociationclass', 'xmi2uml',
         'datatypedependentgenerator',
         'associationclass', order=10)
@handler('anchorinterface', 'xmi2uml',
         'datatypedependentgenerator',
         'interface', order=10)
def anchor(self, source, target):
    """Dummy handler for target preperation.
    """
    target.finalize(source, target.anchor[source.attributes['name']])


tags = [XMI2_1.OWNED_ATTRIBUTE]
registerXMLScope('property', 'xmi2uml', tags)


@handler('property', 'xmi2uml', 'datatypedependentgenerator',
         'property', order=20)
def property(self, source, target):
    """Create property.
    """
    if isprofilemember(source):
        return
    if source.attributes.get('association', None) is not None:
        return
    if 'type' in source.attributes.keys():
        typedef = source.refindex[source.attributes['type']]
        tok = token('sourcetotargetuuidmapping', False)
        type = target.anchor.node(tok.uuids[typedef.uuid])
コード例 #2
0
from agx.core import handler, token
from agx.core.util import write_source_to_target_mapping
from node.ext.xmi.interfaces import IXMINode
from node.ext.uml.core import Profile
from agx.transform.xmi2uml.flavours import get_active_flavour
from configure import registerXMLScope, registerXMIScope


tags = get_active_flavour().profiles()
# XXX: should be implemented, so that regexps are supported
registerXMLScope("profile", "xmi2uml", tags)


@handler("profile", "xmi2uml", "profilegenerator", "profile")
def profile(self, source, target):
    """Create profile.
    """
    profile = Profile()
    target.anchor.root[source.attributes["name"]] = profile
    write_source_to_target_mapping(source, profile)


tags = [get_active_flavour().PACKAGED_ELEMENT]
registerXMIScope("stereotypedef", "xmi2uml", tags, "uml:Stereotype")


@handler("stereotypetokenizer", "xmi2uml", "profilegenerator", "stereotypedef")
def stereotypetokenizer(self, source, target):
    """Collect stereotype definitions from UML profile.
    """
    next = source