MCPcopy Create free account
hub / github.com/TrsstProject/trsst / getText

Method getText

src/main/java/com/trsst/server/LuceneStorage.java:626–642  ·  view source on GitHub ↗
(Node node)

Source from the content-addressed store, hash-verified

624
625 // borrowed from lai-xin-chu: http://stackoverflow.com/questions/12576119
626 private String getText(Node node) {
627 NodeList children = node.getChildNodes();
628 StringBuffer sb = new StringBuffer();
629 for (int i = 0; i < children.getLength(); i++) {
630 Node child = children.item(i);
631 switch (child.getNodeType()) {
632 case Node.ELEMENT_NODE:
633 sb.append(getText(child));
634 sb.append(" ");
635 break;
636 case Node.TEXT_NODE:
637 sb.append(((Text) child).getData());
638 break;
639 }
640 }
641 return sb.toString();
642 }
643
644 /**
645 * Delete an existing entry for the specified feed.

Callers 7

extractTextFromHtmlMethod · 0.95
testAppMethod · 0.80
pullMethod · 0.80
postMethod · 0.80
updateEntryMethod · 0.80
ingestFeedMethod · 0.80
convertFromRSSMethod · 0.80

Calls 1

getDataMethod · 0.80

Tested by 1

testAppMethod · 0.64