Beispiel #1
0
 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);
 }
Beispiel #2
0
 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);
 }