public void remove() { if( null == getParent() ) { return; } getParent().removeNode( this ); } }
public static void replaceChild(Parent parent, Node newChild, Node oldNode) { int idx = parent.nodeIndexOf(oldNode); if (idx < 0) { parent.addNode(newChild); } else { parent.removeNode(idx); parent.addNode(idx, newChild); } }
public static void replaceChild(Parent parent, Node newChild, Node oldNode) { int idx = parent.nodeIndexOf(oldNode); if (idx < 0) { parent.addNode(newChild); } else { parent.removeNode(idx); parent.addNode(idx, newChild); } }
public Document setRootNode (Element rootNode) { if (this.rootNode != null) { removeNode (this.rootNode); } this.rootNode = null; if (rootNode.getParent () != null) { rootNode.getParent ().removeNode (rootNode); } super.addNode (rootNode); return this; }