Exemplo n.º 1
0
  public void DealProperty(org.eclipse.uml2.uml.Property p1, RefOntoUML.Property p2) {
    System.out.print(
        "    Property ("
            + p1.getType().getName()
            + "): "
            + p1.getLower()
            + " "
            + p1.getUpper()
            + " ");

    DealNamedElement(p1, p2);

    // isLeaf (RedefinableElement)
    p2.setIsLeaf(p1.isLeaf());
    // isStatic (Feature)
    p2.setIsStatic(p1.isStatic());
    // isReadOnly (StructuralFeature)
    p2.setIsReadOnly(p1.isReadOnly());

    // lower, upper (MultiplicityElement)
    RefOntoUML.LiteralInteger lowerValue = myfactory.createLiteralInteger();
    RefOntoUML.LiteralUnlimitedNatural upperValue = myfactory.createLiteralUnlimitedNatural();
    lowerValue.setValue(p1.getLower());
    upperValue.setValue(p1.getUpper());

    p2.setLowerValue(lowerValue);
    p2.setUpperValue(upperValue);

    // Type (TypedElement)
    RefOntoUML.Type t2 = (RefOntoUML.Type) GetElement(p1.getType());
    p2.setType(t2);

    // isDerived
    p2.setIsDerived(p1.isDerived());

    // aggregation
    org.eclipse.uml2.uml.AggregationKind ak1 = p1.getAggregation();

    if (ak1.getValue() == org.eclipse.uml2.uml.AggregationKind.NONE) {
      p2.setAggregation(RefOntoUML.AggregationKind.NONE);
    } else if (ak1.getValue() == org.eclipse.uml2.uml.AggregationKind.SHARED) {
      p2.setAggregation(RefOntoUML.AggregationKind.SHARED);
    } else if (ak1.getValue() == org.eclipse.uml2.uml.AggregationKind.COMPOSITE) {
      p2.setAggregation(RefOntoUML.AggregationKind.COMPOSITE);
    }
  }