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

Method setNodeValue

src/main/java/org/htmlunit/html/HtmlTitle.java:53–66  ·  view source on GitHub ↗

Allows the text value for the title element be replaced. {@inheritDoc}

(final String message)

Source from the content-addressed store, hash-verified

51 * {@inheritDoc}
52 */
53 @Override
54 public void setNodeValue(final String message) {
55 final DomNode child = getFirstChild();
56 if (child == null) {
57 final DomNode textNode = new DomText(getPage(), message);
58 appendChild(textNode);
59 }
60 else if (child instanceof DomText text) {
61 text.setData(message);
62 }
63 else {
64 throw new IllegalStateException("For title tag, this should be a text node");
65 }
66 }
67
68 /**
69 * {@inheritDoc}

Callers 2

setTitleTextMethod · 0.95
setTextMethod · 0.45

Calls 4

getPageMethod · 0.65
getFirstChildMethod · 0.45
appendChildMethod · 0.45
setDataMethod · 0.45

Tested by

no test coverage detected