use of com.devonfw.cobigen.templates.devon4j.utils.uml.UmlUtil in project cobigen by devonfw.
the class UmlUtilTest method getConnectors.
private List<Connector> getConnectors() {
UmlUtil uml = new UmlUtil();
Node source = null;
Node target = null;
String className = "";
NodeList connectors = this.root.getElementsByTagName("connector");
for (int i = 0; i < connectors.getLength(); i++) {
Node connector = connectors.item(i);
NodeList attributes = connector.getChildNodes();
for (int j = 0; j < attributes.getLength(); j++) {
DeferredNode attr = (DeferredNode) attributes.item(j);
if (attr.getNodeName().equals("source")) {
source = attr;
NodeList sourceAttributes = attr.getChildNodes();
for (int k = 0; k < sourceAttributes.getLength(); k++) {
Node sourceAttr = sourceAttributes.item(k);
if (sourceAttr.getNodeName().equals("model")) {
className = sourceAttr.getAttributes().getNamedItem("name").getTextContent();
}
}
} else if (attr.getNodeName().equals("target")) {
target = attr;
}
}
uml.resolveConnectorsContent(source, target, className);
}
return uml.getConnectors();
}
Aggregations