if (moduleNameString.equals("")) {
String errorString = "Could not obtain module from workspace description.";
throw new BadXMLDocumentException(moduleDescriptionElement, errorString);
}
ModuleName moduleName = ModuleName.make(moduleNameString);
List<Element> childElems = XMLPersistenceHelper.getChildElements(moduleDescriptionElement);
int nChildElems = childElems.size();
// Get the vault info element.
Element vaultElement = (nChildElems < 1) ? null : childElems.get(0);
XMLPersistenceHelper.checkIsElement(vaultElement);
// Get the module revision.
Element moduleRevisionElement = (nChildElems < 2) ? null : childElems.get(1);
XMLPersistenceHelper.checkTag(moduleRevisionElement, WorkspacePersistenceConstants.MODULE_REVISION_TAG);
Integer moduleRevisionNum = XMLPersistenceHelper.getElementIntegerValue(moduleRevisionElement);
if (moduleRevisionNum == null) {
throw new BadXMLDocumentException(moduleRevisionElement, "No module revision found.");
}
// Get resource info.
Element revisionInfoElement = (nChildElems < 3) ? null : childElems.get(2);
XMLPersistenceHelper.checkIsElement(revisionInfoElement);
CALWorkspace.ResourceInfo resourceInfo = loadResourceInfo(revisionInfoElement);
// Update the resource info.
workspace.updateResourceInfo(resourceInfo);
// Get the module location.
VaultLocation storedModuleLocation = getVaultLocation(vaultElement);
// Create the vault info.
VaultElementInfo vaultInfo = VaultElementInfo.makeBasic(storedModuleLocation.getVaultDescriptor(),
moduleName.toSourceText(),
storedModuleLocation.getLocationString(),
moduleRevisionNum.intValue());
// Update the info map.
workspace.updateVaultInfo(moduleName, vaultInfo);