public String toXmlString() { StringBuilder sb = new StringBuilder(); sb.append("<StepBrother "); sb.append("classUuid=\"Structures.uml@_qIwuMIlZEeKhILqZBrW9Hg\" "); sb.append("className=\"org.opaeum.test.StepBrother\" "); sb.append("uid=\"" + this.getUid() + "\" "); if (getName() != null) { sb.append("name=\"" + ModelFormatter.getInstance().formatString(getName()) + "\" "); } sb.append(">"); sb.append("\n<siblingStepSibling_stepSibling propertyId=\"844736339179565915\">"); for (SiblingStepSibling siblingStepSibling_stepSibling : getSiblingStepSibling_stepSibling()) { sb.append("\n" + siblingStepSibling_stepSibling.toXmlString()); } sb.append("\n</siblingStepSibling_stepSibling>"); if (getMotherStepChildren_stepMother() == null) { sb.append("\n<motherStepChildren_stepMother/>"); } else { sb.append("\n<motherStepChildren_stepMother propertyId=\"2474112361200246321\">"); sb.append("\n" + getMotherStepChildren_stepMother().toXmlString()); sb.append("\n</motherStepChildren_stepMother>"); } sb.append("\n</StepBrother>"); return sb.toString(); }
public void buildTreeFromXml(Element xml, Map<String, Object> map) { setUid(xml.getAttribute("uid")); if (xml.getAttribute("name").length() > 0) { setName(ModelFormatter.getInstance().parseString(xml.getAttribute("name"))); } NodeList propertyNodes = xml.getChildNodes(); int i = 0; while (i < propertyNodes.getLength()) { Node currentPropertyNode = propertyNodes.item(i++); if (currentPropertyNode instanceof Element && (currentPropertyNode.getNodeName().equals("siblingStepSibling_stepSibling") || ((Element) currentPropertyNode) .getAttribute("propertyId") .equals("844736339179565915"))) { NodeList propertyValueNodes = currentPropertyNode.getChildNodes(); int j = 0; while (j < propertyValueNodes.getLength()) { Node currentPropertyValueNode = propertyValueNodes.item(j++); if (currentPropertyValueNode instanceof Element) { SiblingStepSibling curVal; try { curVal = IntrospectionUtil.newInstance( ((Element) currentPropertyValueNode).getAttribute("className")); } catch (Exception e) { curVal = org.opaeum.test.util.ModelJavaMetaInfoMap.INSTANCE.newInstance( ((Element) currentPropertyValueNode).getAttribute("classUuid")); } curVal.buildTreeFromXml((Element) currentPropertyValueNode, map); this.z_internalAddToSiblingStepSibling_stepSibling(curVal); curVal.z_internalAddToStepSibling1(this); map.put(curVal.getUid(), curVal); } } } if (currentPropertyNode instanceof Element && (currentPropertyNode.getNodeName().equals("motherStepChildren_stepMother") || ((Element) currentPropertyNode) .getAttribute("propertyId") .equals("2474112361200246321"))) { NodeList propertyValueNodes = currentPropertyNode.getChildNodes(); int j = 0; while (j < propertyValueNodes.getLength()) { Node currentPropertyValueNode = propertyValueNodes.item(j++); if (currentPropertyValueNode instanceof Element) { MotherStepChildren curVal; try { curVal = IntrospectionUtil.newInstance( ((Element) currentPropertyValueNode).getAttribute("className")); } catch (Exception e) { curVal = org.opaeum.test.util.ModelJavaMetaInfoMap.INSTANCE.newInstance( ((Element) currentPropertyValueNode).getAttribute("classUuid")); } curVal.buildTreeFromXml((Element) currentPropertyValueNode, map); this.z_internalAddToMotherStepChildren_stepMother(curVal); curVal.z_internalAddToStepChild(this); map.put(curVal.getUid(), curVal); } } } } }