Ejemplo n.º 1
0
void UmlFormalParameter::write(FileOut & out, UmlClass * cl, int rank, bool uml20) const {
  out.indent();
  out << "<parameter";
  out.idref_prefix(cl, "TEMPLPARAM", rank);
  out << "/>\n";
  out.indent();
  out << "<ownedParameter xmi:type=\"uml:ClassifierTemplateParameter\"";
  out.id_prefix(cl, "TEMPLPARAM", rank);
  out << ">\n";
  out.indent(+1);

  out.indent();
  if (uml20)
    out << "<ownedElement xmi:type=\"uml:Class\"";
  else
    out << "<ownedParameteredElement xmi:type=\"uml:Class\"";
  out.id_prefix(cl, "TEMPLELEM", rank);
  out << " name=\"";
  out.quote(name());
  out << '"';
  out.ref(cl, "templateParameter", "TEMPLPARAM", rank);
  out << "/>\n";

  if (defaultValue().type != 0)
    UmlItem::write_default_value(out, defaultValue().type->name(), cl, rank);
  else
    UmlItem::write_default_value(out, defaultValue().explicit_type, cl, rank);

  out.indent(-1);
  out.indent();
  out << "</ownedParameter>\n";
}
Ejemplo n.º 2
0
void UmlRelation::write_ends(FileOut & out) {
  // note : it is the first side
 
  out.indent();
  out << "\t<memberEnd";
  out.idref(this);
  out << "/>\n";
  
  UmlRelation * other = side(FALSE);
  
  out.indent();
  if (other != 0) {
    out << "\t<memberEnd";
    out.idref(other);
    out << "/>\n";
  }
  else {
    out << "\t<ownedEnd xmi:type=\"uml:Property\"";
    out.id_prefix(this, "REVERSE_");
    if (_assoc_class != 0)
      out.ref(_assoc_class, "association");
    else
      out.ref(this, "association", "ASSOC_");
    out << " visibility=\"" << ((_vis_prefix) ? "vis_private\"" : "private\"");
    out.ref(parent(), "type");
    out << " aggregation=\"";
    if (_gen_eclipse)
      out << "none";
    else {
      switch (relationKind()) {
      case anAggregation:
      case aDirectionalAggregation:
	out << "shared";
	break;
      case anAggregationByValue:
      case aDirectionalAggregationByValue:
	out << "composite";
	break;
      default:
	out << "none";
      }
    }
    out << "\" isNavigable=\"false\"/>\n";

    out.indent();
    out << "\t<memberEnd ";
    out.idref_prefix(this, "REVERSE_");
    out << "/>\n";
  }

}
Ejemplo n.º 3
0
void UmlClass::write_actuals(FileOut & out)
{
    Q3ValueList<UmlActualParameter> actual_params = actuals();
    Q3ValueList<UmlActualParameter>::ConstIterator iter;
    int rank;
    UmlClass * super = 0;

    for (iter = actual_params.begin(), rank = 0;
         iter != actual_params.end();
         ++iter, rank += 1) {
        if (super != (*iter).superClass()) {
            if (super != 0) {
                out.indent(-1);
                out.indent();
                out << "</templateBinding>\n";
            }

            super = (*iter).superClass();

            out.indent();
            out << "<templateBinding xmi:type=\"uml:TemplateBinding\"";
            out.id_prefix(this, "ACTUAL", rank);
            out << ">\n";
            out.indent(+1);

            out.indent();
            out << "<boundElement";
            out.idref(this);
            out << " />\n";

            out.indent();
            out << "<signature";
            out.idref_prefix(super, "FORMALS_");
            out << " />\n";
        }

        (*iter).write(out, this, rank);
    }

    if (super != 0) {
        out.indent(-1);
        out.indent();
        out << "</templateBinding>\n";
    }

}