private ItemData updatePath ( QPath parentOld , QPath parent , ItemData oldItemData ) throws IllegalPathException { int relativeDegree = oldItemData . getQPath ( ) . getDepth ( ) - parentOld . getDepth ( ) ; QPath newQPath = QPath . makeChildPath ( parent , oldItemData . getQPath ( ) . getRelPath ( relativeDegree ) ) ; ItemData newItemData ; if ( oldItemData . isNode ( ) ) { NodeData oldNodeData = ( NodeData ) oldItemData ; newItemData = new TransientNodeData ( newQPath , oldNodeData . getIdentifier ( ) , oldNodeData . getPersistedVersion ( ) , oldNodeData . getPrimaryTypeName ( ) , oldNodeData . getMixinTypeNames ( ) , oldNodeData . getOrderNumber ( ) , oldNodeData . getParentIdentifier ( ) , oldNodeData . getACL ( ) ) ; } else { PropertyData oldPropertyData = ( PropertyData ) oldItemData ; newItemData = new TransientPropertyData ( newQPath , oldPropertyData . getIdentifier ( ) , oldPropertyData . getPersistedVersion ( ) , oldPropertyData . getType ( ) , oldPropertyData . getParentIdentifier ( ) , oldPropertyData . isMultiValued ( ) , oldPropertyData . getValues ( ) ) ; } return newItemData ; }
Updates the path of the item data and gives the updated objects