MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / getScriptCode

Method getScriptCode

src/main/java/org/htmlunit/html/HtmlScript.java:222–231  ·  view source on GitHub ↗

Gets the script held within the script tag.

()

Source from the content-addressed store, hash-verified

220 * Gets the script held within the script tag.
221 */
222 private String getScriptCode() {
223 final Iterable<DomNode> textNodes = getChildren();
224 final StringBuilder scriptCode = new StringBuilder();
225 for (final DomNode node : textNodes) {
226 if (node instanceof DomText domText) {
227 scriptCode.append(domText.getData());
228 }
229 }
230 return scriptCode.toString();
231 }
232
233 /**
234 * Indicates if a node without children should be written in expanded form as XML

Callers 1

toStringMethod · 0.95

Calls 4

getChildrenMethod · 0.45
appendMethod · 0.45
getDataMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected