changes contributed by Holger integrated (see issue #31237) release35-BLD200303032350
authormmatula@netbeans.org
Wed, 26 Feb 2003 23:54:29 +0000
changeset 12130e66715eabfa
parent 1212 06f15258d6a7
child 1214 e6154b499c81
changes contributed by Holger integrated (see issue #31237)
mdr/extras/uml2mof/src/org/netbeans/lib/jmi/uml2mof/Transformer.java
     1.1 --- a/mdr/extras/uml2mof/src/org/netbeans/lib/jmi/uml2mof/Transformer.java	Wed Feb 26 22:25:47 2003 +0000
     1.2 +++ b/mdr/extras/uml2mof/src/org/netbeans/lib/jmi/uml2mof/Transformer.java	Wed Feb 26 23:54:29 2003 +0000
     1.3 @@ -375,7 +375,8 @@
     1.4      private void transformAssocEnd(AssociationEnd assocEnd, javax.jmi.model.Namespace container) {
     1.5          if (elements.containsKey(assocEnd)) return;
     1.6          
     1.7 -        javax.jmi.model.AssociationEnd mofEnd = mof.getAssociationEnd().createAssociationEnd(assocEnd.getName(), getAnnotation(assocEnd), assocEnd.isNavigable(), getAggregation(assocEnd.getAggregation()), getMultiplicity(assocEnd.getMultiplicity(), OrderingKindEnum.OK_ORDERED.equals(assocEnd.getOrdering()), true), ChangeableKindEnum.CK_CHANGEABLE.equals(assocEnd.getChangeability()));
     1.8 +        boolean changeable = assocEnd.getChangeability() == null || ChangeableKindEnum.CK_CHANGEABLE.equals(assocEnd.getChangeability());
     1.9 +        javax.jmi.model.AssociationEnd mofEnd = mof.getAssociationEnd().createAssociationEnd(assocEnd.getName(), getAnnotation(assocEnd), assocEnd.isNavigable(), getAggregation(assocEnd.getAggregation()), getMultiplicity(assocEnd.getMultiplicity(), OrderingKindEnum.OK_ORDERED.equals(assocEnd.getOrdering()), true), changeable);
    1.10          elements.put(assocEnd, mofEnd);
    1.11          mofEnd.setContainer(container);
    1.12          mapTags(assocEnd, mofEnd);
    1.13 @@ -395,7 +396,8 @@
    1.14              mofFeature = mof.getReference().createReference(attr.getName(), getAnnotation(attr), ScopeKindEnum.INSTANCE_LEVEL, VisibilityKindEnum.PUBLIC_VIS, null, true);
    1.15              fqnsToResolve.put(mofFeature, getTagValues(attr, TAG_REFERENCED_END));
    1.16          } else {
    1.17 -            mofFeature = mof.getAttribute().createAttribute(attr.getName(), getAnnotation(attr), getScope(attr.getOwnerScope()), VisibilityKindEnum.PUBLIC_VIS, getMultiplicity(attr.getMultiplicity(), OrderingKindEnum.OK_ORDERED.equals(attr.getOrdering()), "true".equals(getTagValue(attr, TAG_UNIQUE, null))), ChangeableKindEnum.CK_CHANGEABLE.equals(attr.getChangeability()), "true".equals(getTagValue(attr, TAG_ATTR_DERIVED, null)));
    1.18 +            boolean changeable = attr.getChangeability() == null || ChangeableKindEnum.CK_CHANGEABLE.equals(attr.getChangeability());
    1.19 +            mofFeature = mof.getAttribute().createAttribute(attr.getName(), getAnnotation(attr), getScope(attr.getOwnerScope()), VisibilityKindEnum.PUBLIC_VIS, getMultiplicity(attr.getMultiplicity(), OrderingKindEnum.OK_ORDERED.equals(attr.getOrdering()), "true".equals(getTagValue(attr, TAG_UNIQUE, null))), changeable, "true".equals(getTagValue(attr, TAG_ATTR_DERIVED, null)));
    1.20          }
    1.21          elements.put(attr, mofFeature);
    1.22          mofFeature.setContainer(container);
    1.23 @@ -517,14 +519,24 @@
    1.24          for (Iterator it = umlElement.getTaggedValue().iterator(); it.hasNext();) {
    1.25              TaggedValue tag = (TaggedValue) it.next();
    1.26              String tagName = tag.getName();
    1.27 -            if (tagName == null || tagName.startsWith("org.omg.uml2mof.") || tagName.startsWith("org.netbeans.uml2mof.")) continue;
    1.28 -            if (!elements.containsKey(tag)) {
    1.29 -                info("copying tag: " + tagName);
    1.30 -                Tag mofTag = mof.getTag().createTag(tagName, getAnnotation(tag), tagName, new ArrayList(tag.getDataValue()));
    1.31 -                mofTag.setContainer(outermost);
    1.32 -                mofTag.getElements().add(mofElement);
    1.33 -                elements.put(tag, mofTag);
    1.34 +            if (tag.getType() != null && tag.getType().getTagType() != null) {
    1.35 +                tagName = tag.getType().getTagType();
    1.36              }
    1.37 +            mapTag(tagName, tag, mofElement);
    1.38 +        }
    1.39 +    }
    1.40 +
    1.41 +    private void mapTag(String tagName, TaggedValue tag, javax.jmi.model.ModelElement mofElement) {
    1.42 +        if (tagName != null 
    1.43 +          && !tagName.equals("element.uuid") 
    1.44 +          && !tagName.startsWith("org.omg.uml2mof.") 
    1.45 +          && !tagName.startsWith("org.netbeans.uml2mof.")) {
    1.46 +            info("copying tag: " + tagName);
    1.47 +            Tag mofTag = mof.getTag().createTag(tagName, getAnnotation(tag), tagName,
    1.48 +            new ArrayList(tag.getDataValue()));
    1.49 +            mofTag.setContainer(outermost);
    1.50 +            mofTag.getElements().add(mofElement);
    1.51 +            elements.put(tag, mofTag);
    1.52          }
    1.53      }
    1.54