xml.append("</ContainerManager>\n");
return xml.toString();
}
public ContainerManager initializeFromNode(Realm realm, Node node) {
ContainerManager containerManager = new ContainerManager(realm, containerUnit);
Node resourceStorageNode = XMLConverterUtility.findNode(node, "ResourceStorage");
ResourceStorageManager resourceStorageManager = new ResourceStorageManagerXMLConverter().initializeFromNode(realm, resourceStorageNode);
containerManager.setResourceStorageManager(resourceStorageManager);
Node unitContainerManagerNode = XMLConverterUtility.findNode(node, "UnitContainerManager");
if (unitContainerManagerNode != null) {
UnitContainerManager unitContainerManager = new UnitContainerManagerXMLConverter(containerUnit).initializeFromNode(realm, unitContainerManagerNode);
containerManager.setUnitContainerManager(unitContainerManager);
}
Node populationNode = XMLConverterUtility.findNode(node, "containedPopulation");
if (populationNode != null) {
int population = Integer.parseInt(populationNode.getFirstChild().getNodeValue());
containerManager.setContainedPopulation(population);
}
return containerManager;
}