public String getProperty(String pPropertyName) { String propertyValue = null; NodeList nodeList = mConfigFileDocument.getElementsByTagName(pPropertyName); int nodeListLength = nodeList.getLength(); if (nodeListLength > 0) { Node firstChildNode = nodeList.item(nodeListLength - 1).getFirstChild(); if (null != firstChildNode) { propertyValue = firstChildNode.getNodeValue(); } } return (propertyValue); }
FoundItem getFoundItem(Node n, String text) { String s = n.getNodeValue(); if (s == null) s = n.getNodeName(); String string; if (text != null) { int index = s.indexOf(text); int left = Math.max(0, index - 5); int right = Math.min(s.length(), index + text.length() + 20); string = s.substring(left, right); } else string = s; TreeNode tn = jtree.getTreeNode(n); TreePath tp = getTreePath(tn); return new FoundItem(string, tp); }