/** * Return the VM definitions contained in this object as a String of XML. The String * is suitable for storing in the workbench preferences. * <p> * The resulting XML is compatible with the static method <code>parseXMLIntoContainer</code>. * </p> * @return String the results of flattening this object into XML * @throws CoreException if this method fails. Reasons include:<ul> * <li>serialization of the XML document failed</li> * </ul> */ private static String getLibraryInfoAsXML() throws CoreException { Document doc = DebugPlugin.newDocument(); Element config = doc.createElement("libraryInfos"); //$NON-NLS-1$ doc.appendChild(config); // Create a node for each info in the table Iterator<String> locations = fgLibraryInfoMap.keySet().iterator(); while (locations.hasNext()) { String home = locations.next(); LibraryInfo info = fgLibraryInfoMap.get(home); Element locationElemnet = infoAsElement(doc, info); locationElemnet.setAttribute("home", home); //$NON-NLS-1$ config.appendChild(locationElemnet); } // Serialize the Document and return the resulting String return DebugPlugin.serializeDocument(doc); }
String home = locations.next(); LibraryInfo info = fgLibraryInfoMap.get(home); Element locationElemnet = infoAsElement(doc, info); locationElemnet.setAttribute("home", home); //$NON-NLS-1$ config.appendChild(locationElemnet);