MCPcopy Index your code
hub / github.com/apache/groovy / replaceNode

Method replaceNode

src/main/java/groovy/util/Node.java:230–238  ·  view source on GitHub ↗

Replaces the current node with nodes defined using builder-style notation via a Closure. @param c A Closure defining the new nodes using builder-style notation. @return the original now replaced node

(Closure c)

Source from the content-addressed store, hash-verified

228 * @return the original now replaced node
229 */
230 public Node replaceNode(Closure c) {
231 if (parent() == null) {
232 throw new UnsupportedOperationException("Replacing the root node is not supported");
233 }
234 appendNodes(c);
235 getParentList(parent()).remove(this);
236 this.setParent(null);
237 return this;
238 }
239
240 /**
241 * Replaces the current node with the supplied node.

Callers

nothing calls this directly

Calls 12

parentMethod · 0.95
appendNodesMethod · 0.95
getParentListMethod · 0.95
setParentMethod · 0.95
getTailMethod · 0.95
removeMethod · 0.65
nameMethod · 0.65
appendNodeMethod · 0.45
attributesMethod · 0.45
valueMethod · 0.45
addAllMethod · 0.45
childrenMethod · 0.45

Tested by

no test coverage detected