MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / getTextContent

Method getTextContent

src/main/java/org/htmlunit/html/DomNode.java:540–566  ·  view source on GitHub ↗

{@inheritDoc}

()

Source from the content-addressed store, hash-verified

538 * {@inheritDoc}
539 */
540 @Override
541 public String getTextContent() {
542 switch (getNodeType()) {
543 case ELEMENT_NODE:
544 case ATTRIBUTE_NODE:
545 case ENTITY_NODE:
546 case ENTITY_REFERENCE_NODE:
547 case DOCUMENT_FRAGMENT_NODE:
548 final StringBuilder builder = new StringBuilder();
549 for (final DomNode child : getChildren()) {
550 final short childType = child.getNodeType();
551 if (childType != COMMENT_NODE && childType != PROCESSING_INSTRUCTION_NODE) {
552 builder.append(child.getTextContent());
553 }
554 }
555 return builder.toString();
556
557 case TEXT_NODE:
558 case CDATA_SECTION_NODE:
559 case COMMENT_NODE:
560 case PROCESSING_INSTRUCTION_NODE:
561 return getNodeValue();
562
563 default:
564 return null;
565 }
566 }
567
568 /**
569 * {@inheritDoc}

Callers 15

normalizeMethod · 0.95
snapshotMethod · 0.45
assertVersionMethod · 0.45
labelMethod · 0.45
setTextContentMethod · 0.45
typingAndCloneMethod · 0.45
typingAndResetMethod · 0.45
setTextContentMethod · 0.45

Calls 5

getChildrenMethod · 0.95
getNodeValueMethod · 0.95
getNodeTypeMethod · 0.45
appendMethod · 0.45
toStringMethod · 0.45

Tested by 13

snapshotMethod · 0.36
assertVersionMethod · 0.36
labelMethod · 0.36
setTextContentMethod · 0.36
typingAndCloneMethod · 0.36
typingAndResetMethod · 0.36
setTextContentMethod · 0.36