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

Method setText

src/main/java/org/htmlunit/html/HtmlOption.java:304–317  ·  view source on GitHub ↗

Sets the text for this HtmlOption. @param text the text

(final String text)

Source from the content-addressed store, hash-verified

302 * @param text the text
303 */
304 public void setText(final String text) {
305 if (text == null || text.isEmpty()) {
306 removeAllChildren();
307 }
308 else {
309 final DomNode child = getFirstChild();
310 if (child == null) {
311 appendChild(new DomText(getPage(), text));
312 }
313 else {
314 child.setNodeValue(text);
315 }
316 }
317 }
318
319 /**
320 * Gets the text.

Callers

nothing calls this directly

Calls 6

isEmptyMethod · 0.65
getPageMethod · 0.65
removeAllChildrenMethod · 0.45
getFirstChildMethod · 0.45
appendChildMethod · 0.45
setNodeValueMethod · 0.45

Tested by

no test coverage detected