#include <ogdf/fileformats/DinoUmlToGraphConverter.h>
This class performs all necessary steps to obtain a model graph and diagram graphs from the input file which contains an UML model in XML format. In particular the following is done:
The graphs can be accessed via the functions getModelGraph() and getDiagramGraphs().
In debug mode warnings and the content of the model graph and the diagram graphs are written into the log file named umlToGraphConversionLog.txt.
Definition at line 88 of file DinoUmlToGraphConverter.h.
enum ogdf::DinoUmlToGraphConverter::PredefinedInfoIndex [private] |
Predefined info indices for known tag and attribute names.
Definition at line 87 of file DinoUmlToGraphConverter.h.
| ogdf::DinoUmlToGraphConverter::DinoUmlToGraphConverter | ( | const char * | fileName | ) |
Constructor. The constructor performs the following:
| fileName | The file name of the xml file which contains the data of the uml model to be converted into the graph format. |
| ogdf::DinoUmlToGraphConverter::~DinoUmlToGraphConverter | ( | ) |
Destructor. The destructor destroys:
| bool ogdf::DinoUmlToGraphConverter::createDiagramGraphs | ( | ) | [private] |
For each diagram converts the relevant information contained in the parse tree into the data structure of DinoUmlDiagramGraph. Error messages are reported in m_logFile.
| bool ogdf::DinoUmlToGraphConverter::createDiagramGraphsInUMLGraphFormat | ( | SList< UMLGraph * > & | diagramGraphsInUMLGraphFormat | ) | [private] |
Transforms each diagram graph contained in m_diagramGraphs into an equivalent Error messages are reported in m_logFile.
| diagramGraphsInUMLGraphFormat | The list of diagram graphs in UMLGraph format which have been obtained from the diagram graphs. |
| bool ogdf::DinoUmlToGraphConverter::createModelGraph | ( | DinoUmlModelGraph & | modelGraph | ) | [private] |
Converts the relevant information contained in the parse tree into the data structure of DinoUmlModelGraph. Error messages are reported in m_logFile.
| modelGraph | The model graph into which the nodes and edges corresponding to uml elements and uml relations should be inserted. |
| const SList<DinoUmlDiagramGraph*>& ogdf::DinoUmlToGraphConverter::getDiagramGraphs | ( | ) | const [inline] |
Access to diagram graphs.
Definition at line 179 of file DinoUmlToGraphConverter.h.
| const SList<UMLGraph*>& ogdf::DinoUmlToGraphConverter::getDiagramGraphsInUMLGraphFormat | ( | ) | const [inline] |
Access to the diagrams graphs in UMLGraph format.
Definition at line 186 of file DinoUmlToGraphConverter.h.
| const DinoUmlModelGraph& ogdf::DinoUmlToGraphConverter::getModelGraph | ( | ) | const [inline] |
Access to model graph.
Definition at line 172 of file DinoUmlToGraphConverter.h.
| void ogdf::DinoUmlToGraphConverter::initializePredefinedInfoIndices | ( | ) | [private] |
Inserts known strings for tags and attributes into the hashtable of the parser. The info elements for the hashtable are taken from enum PredefinedInfoIndex.
| bool ogdf::DinoUmlToGraphConverter::insertDependencyEdges | ( | const XmlTagObject & | currentRootTag, | |
| DinoUmlModelGraph & | modelGraph | |||
| ) | [private] |
Identifies dependency tags inside the parse tree and inserts a new edge between the corresponding nodes of the involved elements.
| currentRootTag | The tag where to start the search for dependencies. | |
| modelGraph | The model graph into which edges are inserted. |
| bool ogdf::DinoUmlToGraphConverter::insertSpecificClassifierNodes | ( | const XmlTagObject & | currentRootTag, | |
| String | currentPackageName, | |||
| int | desiredClassifier, | |||
| DinoUmlModelGraph & | modelGraph | |||
| ) | [private] |
Tries to find all classifiers of type desiredClassifier inside the parse tree (starting at currentRootTag). Inserts a new node into modelGraph for each classifier found.
| currentRootTag | The tag where to start the search for the desired classifier. | |
| currentPackageName | This string should contain the name of the package path corresponding to currentRootTag. | |
| desiredClassifier | The info index of the desired class (see enum PredefinedInfoIndex). | |
| modelGraph | The model graph into which nodes are inserted. |
| void ogdf::DinoUmlToGraphConverter::printDiagramsInUMLGraphFormat | ( | ofstream & | os | ) |
Prints the content of each diagram to os.
| os | The output stream where to direct the output to. |
| void ogdf::DinoUmlToGraphConverter::printIdToNodeMappingTable | ( | ofstream & | os | ) |
Print hash table which maps the ids to the NodeElements.
| os | The output stream where to direct the output to. |
| bool ogdf::DinoUmlToGraphConverter::traversePackagesAndInsertAssociationEdges | ( | const XmlTagObject & | currentRootTag, | |
| DinoUmlModelGraph & | modelGraph | |||
| ) | [private] |
Traverses the package structure and identifies associations inside the parse tree and inserts a new edge between the corresponding nodes of the involved classifiers.
Note that it is not possible to include this function into traversePackagesAndInsertClassifierNodes(). The reason is that it is possible that edges are specified prior to that one or both nodes have been created.
| currentRootTag | The tag where to start the search for associations. | |
| modelGraph | The model graph into which edges are inserted. |
| bool ogdf::DinoUmlToGraphConverter::traversePackagesAndInsertClassifierNodes | ( | const XmlTagObject & | currentRootTag, | |
| String | currentPackageName, | |||
| DinoUmlModelGraph & | modelGraph | |||
| ) | [private] |
Traverses the package structure and identifies classifiers inside the parse tree (starting at currentRootTag) and inserts a new node for each classifier. This function will call itself recursively while traversing nested packages.
Valid classifiers are currently: class and interface.
| currentRootTag | The tag where to start the search for classifiers. | |
| currentPackageName | This string should contain the name of the package path corresponding to currentRootTag. | |
| modelGraph | The model graph into which nodes are inserted. |
| bool ogdf::DinoUmlToGraphConverter::traversePackagesAndInsertGeneralizationEdges | ( | const XmlTagObject & | currentRootTag, | |
| DinoUmlModelGraph & | modelGraph | |||
| ) | [private] |
Traverses the package structure and identifies generalization inside the parse tree and inserts a new edge between the corresponding nodes of the involved classifiers.
It does not make sense to put this function and traversePackagesAndInsertAssociationEdges() together since the generalization tags are inside the class tags, so first the classes have to be identified again in contrast to traversePackagesAndInsertAssociationEdges().
| currentRootTag | The tag where to start the search for generalizations. | |
| modelGraph | The model graph into which edges are inserted. |
The set of graphs which represent special diagrams contained in the model.
Definition at line 78 of file DinoUmlToGraphConverter.h.
This list contains the set of graphs of the list m_diagramGraphs in UMLGraph format. The transformation is performed in the constructor DinoUmlToGraphConverter().
Definition at line 84 of file DinoUmlToGraphConverter.h.
Hashing<int,EdgeElement*> ogdf::DinoUmlToGraphConverter::m_idToEdge [private] |
Maps string info to edge. The functionality is the same as for m_idToNode.
Definition at line 134 of file DinoUmlToGraphConverter.h.
Hashing<int,NodeElement*> ogdf::DinoUmlToGraphConverter::m_idToNode [private] |
Maps string info to node. We need this hash table for fast access to nodes corresponding to UML elements. For each UML Element in XMI format we have an unique identifier via the xmi.id attribute. The xmi.id attribute is saved as string in the hash table of the parser, hence we can use the info index of it. While scanning for relations between nodes we encounter the xmi.id attribute values of the involved elements referenced as type attribute in the relation. Now we can use the hash table to access the corresponding node.
Definition at line 129 of file DinoUmlToGraphConverter.h.
ofstream* ogdf::DinoUmlToGraphConverter::m_logFile [private] |
The log file. The log file is named umlToGraphConversionLog.txt and contains warnings and errors ocurred during the conversion process. Furthermore it contains the content of the model graph m_modelGraph and of the diagram graphs m_diagramGraphs.
Definition at line 142 of file DinoUmlToGraphConverter.h.
The graph which represents the complete UML model.
Definition at line 73 of file DinoUmlToGraphConverter.h.
The parser used for parsing the input file.
Definition at line 70 of file DinoUmlToGraphConverter.h.