Esempio n. 1
0
  private void handleAssociationEnd(Attributes atts) {
    // get the most recently found association
    UMLAssociation assoc = assocList.get(assocList.size() - 1);
    // TODO: something with type?
    String type = atts.getValue(XMIConstants.XMI_TYPE_ATTRIBUTE);
    boolean isNavigable =
        "true".equals(atts.getValue(XMIConstants.XMI_UML_ASSOCIATION_IS_NAVIGABLE));

    edge = new UMLAssociationEdge();
    if (assoc.getSourceUMLAssociationEdge() == null) {
      assoc.setSourceUMLAssociationEdge(new UMLAssociationSourceUMLAssociationEdge(edge));
      sourceNavigable = isNavigable;
    } else {
      assoc.setTargetUMLAssociationEdge(new UMLAssociationTargetUMLAssociationEdge(edge));
      targetNavigable = isNavigable;
    }
    edge.setRoleName(atts.getValue(XMIConstants.XMI_NAME_ATTRIBUTE));
    edge.setUMLClassReference(new UMLClassReference());
  }
Esempio n. 2
0
 private void handleClassReference(Attributes atts) {
   if (isWithinAssociationEnd()) {
     edge.getUMLClassReference().setRefid(atts.getValue(XMIConstants.XMI_IDREF));
   } else if (isWithinGeneralizationChild()) {
     UMLGeneralization gen = genList.get(genList.size() - 1);
     gen.getSubClassReference().setRefid(atts.getValue(XMIConstants.XMI_IDREF));
   } else if (isWithinGeneralizationParent()) {
     UMLGeneralization gen = genList.get(genList.size() - 1);
     gen.getSuperClassReference().setRefid(atts.getValue(XMIConstants.XMI_IDREF));
   }
 }
Esempio n. 3
0
 private void handleMultiplicity(Attributes atts) {
   edge.setMinCardinality(
       Integer.parseInt(atts.getValue(XMIConstants.XMI_UML_MULTIPLICITY_LOWER)));
   edge.setMaxCardinality(
       Integer.parseInt(atts.getValue(XMIConstants.XMI_UML_MULTIPLICITY_UPPER)));
 }