public void insertParentBefore ( Node node ) throws ChildNodeException { if ( node != null ) { if ( hasParent ( ) ) { getParentNode ( ) . addChild ( node ) ; getParentNode ( ) . removeChild ( this ) ; } node . addChild ( this ) ; } }
Inserts a new Parent into the tree structure and adds this node as its child .