Source:
protected void readGeneralData ( ) { org.ovirt.engine.core.compat.backendcompat.XmlNode content = _document.SelectSingleNode ( "//*/Content" ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node ; vmBase.setOvfVersion ( getVersion ( ) ) ; node = content.SelectSingleNode ( "Description" ) ; if ( node != null ) { vmBase.setDescription ( node.innerText ) ; } node = content.SelectSingleNode ( "Domain" ) ; if ( node != null ) { vmBase.setDomain ( node.innerText ) ; } node = content.SelectSingleNode ( "CreationDate" ) ; if ( node != null ) { java.util.Date creationDate = org.ovirt.engine.core.utils.ovf.OvfParser.UtcDateStringToLocaDate ( node.innerText ) ; if ( creationDate != null ) { vmBase.setCreationDate ( creationDate ) ; } } node = content.SelectSingleNode ( "ExportDate" ) ; if ( node != null ) { java.util.Date exportDate = org.ovirt.engine.core.utils.ovf.OvfParser.UtcDateStringToLocaDate ( node.innerText ) ; if ( exportDate != null ) { vmBase.setExportDate ( exportDate ) ; } } node = content.SelectSingleNode ( "TimeZone" ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setTimeZone ( node.innerText ) ; } } node = content.SelectSingleNode ( "default_boot_sequence" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setDefaultBootSequence ( org.ovirt.engine.core.common.businessentities.BootSequence.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( "initrd_url" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setInitrdUrl ( node.innerText ) ; } } node = content.SelectSingleNode ( "kernel_url" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setKernelUrl ( node.innerText ) ; } } node = content.SelectSingleNode ( "kernel_params" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setKernelParams ( node.innerText ) ; } } node = content.SelectSingleNode ( "Generation" ) ; if ( node != null ) { vmBase.setDbGeneration ( java.lang.Long.parseLong ( node.innerText ) ) ; } else { vmBase.setDbGeneration ( 1L ) ; } node = content.SelectSingleNode ( getDefaultDisplayTypeStringRepresentation ( ) ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { defaultDisplayType = org.ovirt.engine.core.common.businessentities.DisplayType.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ; vmBase.setDefaultDisplayType ( defaultDisplayType ) ; } } org.ovirt.engine.core.compat.backendcompat.XmlNodeList list = content.SelectNodes ( "Section" ) ; if ( list != null ) { node = getNode ( list , "xsi:type" , "ovf:OperatingSystemSection_Type" ) ; if ( node != null ) { readOsSection ( node ) ; if ( ( ! ( osRepository.isLinux ( vmBase.getOsId ( ) ) ) ) || ( ! ( org.ovirt.engine.core.common.FeatureSupported.singleQxlPci ( new org.ovirt.engine.core.compat.Version ( getVersion ( ) ) ) ) ) ) { vmBase.setSingleQxlPci ( false ) ; } } node = getNode ( list , "xsi:type" , "ovf:VirtualHardwareSection_Type" ) ; if ( node != null ) { readHardwareSection ( node ) ; } node = getNode ( list , "xsi:type" , "ovf:SnapshotsSection_Type" ) ; if ( node != null ) { readSnapshotsSection ( node ) ; } } node = content.SelectSingleNode ( "Origin" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setOrigin ( org.ovirt.engine.core.common.businessentities.OriginType.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( "VmType" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setVmType ( org.ovirt.engine.core.common.businessentities.VmType.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( "IsSmartcardEnabled" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setSmartcardEnabled ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "DeleteProtected" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setDeleteProtected ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "SsoMethod" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setSsoMethod ( org.ovirt.engine.core.common.businessentities.SsoMethod.fromString ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "TunnelMigration" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setTunnelMigration ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "VncKeyboardLayout" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setVncKeyboardLayout ( node.innerText ) ; } } node = content.SelectSingleNode ( "MinAllocatedMem" ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setMinAllocatedMem ( java.lang.Integer.parseInt ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "IsStateless" ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setStateless ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "IsRunAndPause" ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setRunAndPause ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "CreatedByUserId" ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setCreatedByUserId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "MigrationDowntime" ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setMigrationDowntime ( java.lang.Integer.parseInt ( node.innerText ) ) ; } } readGeneralData ( content ) ; }

Target:
protected void readGeneralData ( ) { org.ovirt.engine.core.compat.backendcompat.XmlNode content = _document.SelectSingleNode ( "//*/Content" ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node ; vmBase.setVmInit ( new org.ovirt.engine.core.common.businessentities.VmInit ( ) ) ; vmBase.setOvfVersion ( getVersion ( ) ) ; node = content.SelectSingleNode ( "Description" ) ; if ( node != null ) { vmBase.setDescription ( node.innerText ) ; } node = content.SelectSingleNode ( "Domain" ) ; if ( node != null ) { vmBase.getVmInit ( ) . setDomain ( node.innerText ) ; } node = content.SelectSingleNode ( "CreationDate" ) ; if ( node != null ) { java.util.Date creationDate = org.ovirt.engine.core.utils.ovf.OvfParser.UtcDateStringToLocaDate ( node.innerText ) ; if ( creationDate != null ) { vmBase.setCreationDate ( creationDate ) ; } } node = content.SelectSingleNode ( "ExportDate" ) ; if ( node != null ) { java.util.Date exportDate = org.ovirt.engine.core.utils.ovf.OvfParser.UtcDateStringToLocaDate ( node.innerText ) ; if ( exportDate != null ) { vmBase.setExportDate ( exportDate ) ; } } node = content.SelectSingleNode ( "TimeZone" ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setTimeZone ( node.innerText ) ; } } node = content.SelectSingleNode ( "default_boot_sequence" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setDefaultBootSequence ( org.ovirt.engine.core.common.businessentities.BootSequence.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( "initrd_url" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setInitrdUrl ( node.innerText ) ; } } node = content.SelectSingleNode ( "kernel_url" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setKernelUrl ( node.innerText ) ; } } node = content.SelectSingleNode ( "kernel_params" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setKernelParams ( node.innerText ) ; } } node = content.SelectSingleNode ( "Generation" ) ; if ( node != null ) { vmBase.setDbGeneration ( java.lang.Long.parseLong ( node.innerText ) ) ; } else { vmBase.setDbGeneration ( 1L ) ; } node = content.SelectSingleNode ( getDefaultDisplayTypeStringRepresentation ( ) ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { defaultDisplayType = org.ovirt.engine.core.common.businessentities.DisplayType.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ; vmBase.setDefaultDisplayType ( defaultDisplayType ) ; } } org.ovirt.engine.core.compat.backendcompat.XmlNodeList list = content.SelectNodes ( "Section" ) ; if ( list != null ) { node = getNode ( list , "xsi:type" , "ovf:OperatingSystemSection_Type" ) ; if ( node != null ) { readOsSection ( node ) ; if ( ( ! ( osRepository.isLinux ( vmBase.getOsId ( ) ) ) ) || ( ! ( org.ovirt.engine.core.common.FeatureSupported.singleQxlPci ( new org.ovirt.engine.core.compat.Version ( getVersion ( ) ) ) ) ) ) { vmBase.setSingleQxlPci ( false ) ; } } node = getNode ( list , "xsi:type" , "ovf:VirtualHardwareSection_Type" ) ; if ( node != null ) { readHardwareSection ( node ) ; } node = getNode ( list , "xsi:type" , "ovf:SnapshotsSection_Type" ) ; if ( node != null ) { readSnapshotsSection ( node ) ; } } node = content.SelectSingleNode ( "Origin" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setOrigin ( org.ovirt.engine.core.common.businessentities.OriginType.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( "VmType" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setVmType ( org.ovirt.engine.core.common.businessentities.VmType.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( "IsSmartcardEnabled" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setSmartcardEnabled ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "DeleteProtected" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setDeleteProtected ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "SsoMethod" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setSsoMethod ( org.ovirt.engine.core.common.businessentities.SsoMethod.fromString ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "TunnelMigration" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setTunnelMigration ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "VncKeyboardLayout" ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setVncKeyboardLayout ( node.innerText ) ; } } node = content.SelectSingleNode ( "MinAllocatedMem" ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setMinAllocatedMem ( java.lang.Integer.parseInt ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "IsStateless" ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setStateless ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "IsRunAndPause" ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setRunAndPause ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "CreatedByUserId" ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setCreatedByUserId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( node.innerText ) ) ; } } node = content.SelectSingleNode ( "MigrationDowntime" ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setMigrationDowntime ( java.lang.Integer.parseInt ( node.innerText ) ) ; } } readGeneralData ( content ) ; readVmInit ( content ) ; }