Ejemplo n.º 1
0
void SQLWriter::printAttributes(QTextStream& sql, UMLAttributeList attributeList, bool first) {
    QString attrDoc = "";
    UMLAttribute* at;

    for (at=attributeList.first();at;at=attributeList.next())
    {
        // print , after attribute
        if (first == false) {
            sql <<",";
        } else {
            first = false;
        }

        // print documentation/comment of last attribute at end of line
        if (attrDoc.isEmpty() == false)
        {
            sql << " -- " << attrDoc << m_endl;
        } else {
            sql << m_endl;
        }

        // write the attribute
        sql << m_indentation << cleanName(at->getName()) << " " << at->getTypeName() << " "
        << (at->getInitialValue().isEmpty()?QString(""):QString(" DEFAULT ")+at->getInitialValue());

        // now get documentation/comment of current attribute
        attrDoc = at->getDoc();
    }

    // print documentation/comment at end of line
    if (attrDoc.isEmpty() == false)
    {
        sql << " -- " << attrDoc << m_endl;
    } else {
        sql << m_endl;
    }

    return;
}
Ejemplo n.º 2
0
/**
 * Utility method to get the value of parent object type.
 * the typeName of this parameters (e.g. boolean, int, etc or perhaps Class name of
 * an object)
 * @return the value of type
 */
QString CodeParameter::getTypeName ( )
{
    UMLAttribute * at = (UMLAttribute*) m_parentObject;
    return at->getTypeName();
}