ElementPropertyDefn propDefn = destination.getElement( ) .getPropertyDefn( propName );
Object localValue = to.getLocalProperty( from.getRoot( ), propDefn ); Object parentValue = from.getPropertyFromElement( from.getRoot( ), propDefn );
	public static void duplicateProperties( DesignElementHandle source,			DesignElementHandle destination, boolean onlyFactoryProperty )	{		assert source != null;		assert destination != null;		if ( !( ( source instanceof ReportDesignHandle ) && ( destination instanceof LibraryHandle ) ) )			assert destination.getDefn( ).getName( ).equalsIgnoreCase(					source.getDefn( ).getName( ) );		if ( source.getDefn( ).allowsUserProperties( ) )		{			PropertyHandle propHandle = source					.getPropertyHandle( DesignElement.USER_PROPERTIES_PROP );			Object value = source.getElement( ).getUserProperties( );			Object valueToSet = null;			if ( propHandle != null )			{				valueToSet = ModelUtil.copyValue( propHandle.getDefn( ), value );			}			if ( valueToSet != null )			{				Iterator iter = ( (List) valueToSet ).iterator( );				while ( iter.hasNext( ) )				{					UserPropertyDefn userPropDefn = (UserPropertyDefn) iter							.next( );					destination.getElement( )							.addUserPropertyDefn( userPropDefn );				}			}		}		if ( source.getElement( ) instanceof IExtendableElement )			duplicateExtensionIdentifier( source, destination );		Iterator iter = source.getPropertyIterator( );		while ( iter.hasNext( ) )		{			PropertyHandle propHandle = (PropertyHandle) iter.next( );			String propName = propHandle.getDefn( ).getName( );			// Style property and extends property will be removed.			// The properties inherited from style or parent will be			// flatten to new element.			if ( StyledElement.STYLE_PROP.equals( propName )					|| DesignElement.EXTENDS_PROP.equals( propName )					|| DesignElement.USER_PROPERTIES_PROP.equals( propName )					|| IOdaExtendableElementModel.EXTENSION_ID_PROP							.equals( propName )					|| IExtendedItemModel.EXTENSION_NAME_PROP.equals( propName ) )				continue;			ElementPropertyDefn propDefn = destination.getElement( )					.getPropertyDefn( propName );			if ( propDefn == null )				continue;			Object value = null;			// the special case for the toc property on the group element since			// the default toc is the group expression.			if ( propHandle.getElement( ) instanceof GroupElement					&& GroupElement.TOC_PROP.equals( propName ) )				value = propHandle.getElement( ).getLocalProperty(						propHandle.getModule( ), propDefn );			else if ( onlyFactoryProperty )				value = propHandle.getElement( ).getFactoryProperty(						propHandle.getModule( ), propDefn );			else				value = propHandle.getElement( ).getPropertyExceptRomDefault(						propHandle.getModule( ), propDefn );			Object valueToSet = ModelUtil.copyValue( propHandle.getDefn( ),					value );			destination.getElement( ).setProperty( propName, valueToSet );		}	}