@Override public Text clone() { return cloneTo(new Text(ownerDocument, nodeValue)); }
@Override public void text(final CharSequence text) { if (!enabled) { return; } String textValue = text.toString(); Node node = new Text(rootNode, textValue); parentNode.addChild(node); }
@Override public void script(final Tag tag, final CharSequence body) { if (!enabled) { return; } Element node = createElementNode(tag); parentNode.addChild(node); if (body.length() != 0) { Node text = new Text(rootNode, body.toString()); node.addChild(text); } }
/** * Sets the content of each element in the set of matched elements to the specified text. */ public Jerry text(String text) { if (nodes.length == 0) { return this; } if (text == null) { text = StringPool.EMPTY; } for (Node node : nodes) { node.removeAllChilds(); Text textNode = new Text(node.getOwnerDocument(), text); node.addChild(textNode); } return this; }
newPerson.getChild(0).addChild(new Text(xml, "Just Maria"));
@Test void testReindexOne() { Document document = new Document(); Element one = new Element(document, "one"); document.addChild(one); assertEquals(1, document.childElementNodesCount); assertEquals(0, one.siblingElementIndex); Element two = new Element(document, "two"); document.addChild(two); assertEquals(2, document.childElementNodesCount); assertEquals(0, one.siblingElementIndex); assertEquals(1, two.siblingElementIndex); Text three = new Text(document, "xxx"); document.addChild(three); Element four = new Element(document, "four"); document.addChild(four); assertEquals(3, document.childElementNodesCount); assertEquals(0, one.siblingElementIndex); assertEquals(1, two.siblingElementIndex); assertEquals(2, four.siblingElementIndex); }
@Override public Text clone() { return cloneTo(new Text(ownerDocument, nodeValue)); }
public void text(CharSequence text) { if (!enabled) { return; } String textValue = text.toString(); Node node = new Text(textValue); parentNode.addChild(node); }
public void text(CharSequence text) { if (!enabled) { return; } String textValue = text.toString(); Node node = new Text(rootNode, textValue); parentNode.addChild(node); }
@Override public void text(final CharSequence text) { if (!enabled) { return; } String textValue = text.toString(); Node node = new Text(rootNode, textValue); parentNode.addChild(node); }
@Override public Text clone() { return cloneTo(new Text(nodeValue)); }
@Override public Text clone() { return cloneTo(new Text(ownerDocument, nodeValue)); }
public void xmp(Tag tag, CharSequence body) { if (!enabled) { return; } Node node = createElementNode(tag); parentNode.addChild(node); if (body.length() != 0) { Node text = new Text(body.toString()); node.addChild(text); } }
public void script(Tag tag, CharSequence body) { if (!enabled) { return; } Element node = createElementNode(tag); parentNode.addChild(node); if (body.length() != 0) { Node text = new Text(rootNode, body.toString()); node.addChild(text); } }
@Override public void script(final Tag tag, final CharSequence body) { if (!enabled) { return; } Element node = createElementNode(tag); parentNode.addChild(node); if (body.length() != 0) { Node text = new Text(rootNode, body.toString()); node.addChild(text); } }
public void style(Tag tag, CharSequence body) { if (!enabled) { return; } Element node = createElementNode(tag); parentNode.addChild(node); if (body.length() != 0) { Node text = new Text(body.toString()); node.addChild(text); } }
public void script(Tag tag, CharSequence body) { if (!enabled) { return; } Element node = createElementNode(tag); parentNode.addChild(node); if (body.length() != 0) { Node text = new Text(body.toString()); node.addChild(text); } }
/** * Sets the content of each element in the set of matched elements to the specified text. */ public Jerry text(String text) { for (Node node : nodes) { node.removeAllChilds(); Text textNode = new Text(); textNode.setTextContent(text); node.addChild(textNode); } return this; }
/** * Sets the content of each element in the set of matched elements to the specified text. */ public Jerry text(String text) { for (Node node : nodes) { node.removeAllChilds(); Text textNode = new Text(node.getOwnerDocument(), text); node.addChild(textNode); } return this; }