protected void addChild ( ElementBase child , boolean doEvent ) { if ( ! child . canAcceptParent ( this ) ) { CWFException . raise ( child . rejectReason ) ; } if ( ! canAcceptChild ( child ) ) { CWFException . raise ( rejectReason ) ; } if ( doEvent ) { beforeAddChild ( child ) ; } if ( child . getParent ( ) != null ) { child . getParent ( ) . removeChild ( child , false ) ; } children . add ( child ) ; child . updateParent ( this ) ; if ( doEvent ) { afterAddChild ( child ) ; } }
Adds the specified child element . The validity of the operation is first tested and an exception thrown if the element is not a valid child for this parent .