netbeans api to read bookmark line numbers

Below code can read out bookmark line numbers for netbeans. For Java project, the bookmark line number are stored in nbproject/private/private.xml. If it is maven project, the private.xml is not exist but this code still work, there must be some place to store the bookmark info but I just don’t know. These code has a weak point, it won’t read the latest line numbers unless you close the project/netbeans.

			Project project = NetbeansUtil.getProject();
			AuxiliaryConfiguration config = ProjectUtils.getAuxiliaryConfiguration(project);
			org.w3c.dom.Element element = config.getConfigurationFragment("editor-bookmarks", "", false);
			ModuleLib.log("element=" + element);
			if (element != null) {
				NodeList list = element.getElementsByTagNameNS("", "bookmark");
				for (int x = 0; x < list.getLength(); x++) {
					org.w3c.dom.Element enEl = (org.w3c.dom.Element) list.item(x);
					String lineNo = enEl.getTextContent().trim();
					ModuleLib.log("line no=" + lineNo);

read count : 9