コード例 #1
0
  private Element createEntityNode(IEntity entity) {
    // <UML:Class xmi.id="UMLClass.5" name="Class1" visibility="public"
    // isSpecification="false"
    // namespace="UMLModel.4" isRoot="false" isLeaf="false"
    // isAbstract="false" participant="UMLAssociationEnd.11"
    // isActive="false">
    final Element cla = document.createElement("UML:Class");

    cla.setAttribute("xmi.id", entity.getUid());
    cla.setAttribute("name", entity.getDisplay2().get(0).toString());
    cla.setAttribute("namespace", "model1");

    final Element feature = document.createElement("UML:Classifier.feature");
    cla.appendChild(feature);

    for (Member m : entity.getFieldsToDisplay()) {
      // <UML:Attribute xmi.id="UMLAttribute.6" name="Attribute1"
      // visibility="public" isSpecification="false"
      // ownerScope="instance" changeability="changeable"
      // targetScope="instance" type="" owner="UMLClass.5"/>
      final Element attribute = document.createElement("UML:Attribute");
      attribute.setAttribute("xmi.id", "att" + UniqueSequence.getValue());
      attribute.setAttribute("name", m.getDisplayWithoutVisibilityChar());
      feature.appendChild(attribute);
    }

    for (Member m : entity.getMethodsToDisplay()) {
      // <UML:Operation xmi.id="UMLOperation.7" name="Operation1"
      // visibility="public" isSpecification="false"
      // ownerScope="instance" isQuery="false" concurrency="sequential"
      // isRoot="false" isLeaf="false"
      // isAbstract="false" specification="" owner="UMLClass.5"/>
      final Element operation = document.createElement("UML:Operation");
      operation.setAttribute("xmi.id", "att" + UniqueSequence.getValue());
      operation.setAttribute("name", m.getDisplayWithoutVisibilityChar());
      feature.appendChild(operation);
    }
    return cla;
  }
コード例 #2
0
 private Element createEntityNodeRef(IEntity entity) {
   final Element cla = document.createElement("UML:Class");
   cla.setAttribute("xmi.idref", entity.getUid());
   return cla;
 }