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

Method asText

src/main/java/org/htmlunit/html/XmlSerializer.java:152–165  ·  view source on GitHub ↗

@param node a node @return the text representation according to the setting of this serializer

(final DomNode node)

Source from the content-addressed store, hash-verified

150 * @return the text representation according to the setting of this serializer
151 */
152 public String asText(final DomNode node) {
153 builder_.setLength(0);
154
155 if (node instanceof DomText text) {
156 builder_.append(text.getData());
157 }
158 else {
159 printText(node);
160 }
161
162 final String response = builder_.toString();
163 builder_.setLength(0);
164 return response;
165 }
166
167 /**
168 * Prints the text content from this node and all children.

Callers

nothing calls this directly

Calls 5

printTextMethod · 0.95
setLengthMethod · 0.45
appendMethod · 0.45
getDataMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected