Search in sources :

Example 1 with Text

use of jodd.lagarto.dom.Text in project jodd by oblac.

the class Jerry method 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;
}
Also used : Node(jodd.lagarto.dom.Node) Text(jodd.lagarto.dom.Text)

Aggregations

Node (jodd.lagarto.dom.Node)1 Text (jodd.lagarto.dom.Text)1