Source:
protected void ReadGeneralData ( ) { org.ovirt.engine.core.compat.backendcompat.XmlNode content = _document.SelectSingleNode ( "//*/Content" ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = content.SelectSingleNode ( "Name" ) ; if ( node != null ) { _vm.getStaticData ( ) . setvm_name ( node.InnerText ) ; name = _vm.getStaticData ( ) . getvm_name ( ) ; } node = content.SelectSingleNode ( "TemplateId" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.getStaticData ( ) . setvmt_guid ( new org.ovirt.engine.core.compat.Guid ( node.InnerText ) ) ; } } node = content.SelectSingleNode ( "TemplateName" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setvmt_name ( node.InnerText ) ; } } node = content.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vm.getStaticData ( ) . setdescription ( node.InnerText ) ; } node = content.SelectSingleNode ( "Domain" ) ; if ( node != null ) { _vm.getStaticData ( ) . setdomain ( node.InnerText ) ; } node = content.SelectSingleNode ( "CreationDate" ) ; final java.util.Date creationDate = org.ovirt.engine.core.utils.ovf.OvfParser.UtcDateStringToLocaDate ( node.InnerText ) ; if ( creationDate != null ) { _vm.getStaticData ( ) . setcreation_date ( creationDate ) ; } node = content.SelectSingleNode ( "ExportDate" ) ; final java.util.Date exportDate = org.ovirt.engine.core.utils.ovf.OvfParser.UtcDateStringToLocaDate ( node.InnerText ) ; if ( exportDate != null ) { _vm.getStaticData ( ) . setExportDate ( exportDate ) ; } node = content.SelectSingleNode ( "IsInitilized" ) ; if ( node != null ) { _vm.getStaticData ( ) . setis_initialized ( java.lang.Boolean.parseBoolean ( node.InnerText ) ) ; } node = content.SelectSingleNode ( "IsAutoSuspend" ) ; if ( node != null ) { _vm.getStaticData ( ) . setis_auto_suspend ( java.lang.Boolean.parseBoolean ( node.InnerText ) ) ; } node = content.SelectSingleNode ( "TimeZone" ) ; if ( node != null ) { _vm.getStaticData ( ) . settime_zone ( node.InnerText ) ; } node = content.SelectSingleNode ( "IsStateless" ) ; if ( node != null ) { _vm.getStaticData ( ) . setis_stateless ( java.lang.Boolean.parseBoolean ( node.InnerText ) ) ; } org.ovirt.engine.core.compat.backendcompat.XmlNodeList list = content.SelectNodes ( "Section" ) ; for ( org.ovirt.engine.core.compat.backendcompat.XmlNode section : list ) { java.lang.String value = section.Attributes.get ( "xsi:type" ) . getValue ( ) ; if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( value , "ovf:OperatingSystemSection_Type" ) ) { ReadOsSection ( section ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( value , "ovf:VirtualHardwareSection_Type" ) ) { ReadHardwareSection ( section ) ; } else if ( org.apache.commons.lang.StringUtils.equals ( value , "ovf:SnapshotsSection_Type" ) ) { readSnapshotsSection ( section ) ; } } node = content.SelectSingleNode ( "Origin" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setorigin ( org.ovirt.engine.core.common.businessentities.OriginType.forValue ( java.lang.Integer.parseInt ( node.InnerText ) ) ) ; } } node = content.SelectSingleNode ( "initrd_url" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setinitrd_url ( node.InnerText ) ; } } node = content.SelectSingleNode ( "default_boot_sequence" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setdefault_boot_sequence ( org.ovirt.engine.core.common.businessentities.BootSequence.forValue ( java.lang.Integer.parseInt ( node.InnerText ) ) ) ; } } node = content.SelectSingleNode ( "kernel_url" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setkernel_url ( node.InnerText ) ; } } node = content.SelectSingleNode ( "kernel_params" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setkernel_params ( node.InnerText ) ; } } org.ovirt.engine.core.utils.ovf.OvfLogEventHandler < org.ovirt.engine.core.common.businessentities.VmStatic > handler = new org.ovirt.engine.core.utils.ovf.VMStaticOvfLogHandler ( _vm.getStaticData ( ) ) ; java.util.List < java.lang.String > aliases = handler.getAliases ( ) ; for ( java.lang.String alias : aliases ) { java.lang.String value = readEventLogValue ( content , alias ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( value ) ) ) { handler.addValueForAlias ( alias , value ) ; } } node = content.SelectSingleNode ( "app_list" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setapp_list ( node.InnerText ) ; } } else if ( ( ( _images ) != null ) && ( ( _images.size ( ) ) > 0 ) ) { int root = org.ovirt.engine.core.utils.ovf.OvfVmReader.GetFirstImage ( _images , _images.get ( 0 ) ) ; if ( root != ( - 1 ) ) { for ( int i = 0 ; i < ( _images.size ( ) ) ; i ++ ) { int x = org.ovirt.engine.core.utils.ovf.OvfVmReader.GetNextImage ( _images , _images.get ( i ) ) ; if ( x == ( - 1 ) ) { _vm.setapp_list ( _images.get ( i ) . getappList ( ) ) ; } } } else { _vm.setapp_list ( _images.get ( 0 ) . getappList ( ) ) ; } } node = content.SelectSingleNode ( "VmType" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setvm_type ( org.ovirt.engine.core.common.businessentities.VmType.forValue ( java.lang.Integer.parseInt ( node.InnerText ) ) ) ; } } node = content.SelectSingleNode ( "DefaultDisplayType" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setdefault_display_type ( org.ovirt.engine.core.common.businessentities.DisplayType.forValue ( java.lang.Integer.parseInt ( node.InnerText ) ) ) ; } } node = content.SelectSingleNode ( "MinAllocatedMem" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setMinAllocatedMem ( java.lang.Integer.parseInt ( node.InnerText ) ) ; } } }

Target:
protected void ReadGeneralData ( ) { org.ovirt.engine.core.compat.backendcompat.XmlNode content = _document.SelectSingleNode ( "//*/Content" ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = content.SelectSingleNode ( "Name" ) ; if ( node != null ) { _vm.getStaticData ( ) . setvm_name ( node.InnerText ) ; name = _vm.getStaticData ( ) . getvm_name ( ) ; } node = content.SelectSingleNode ( "TemplateId" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.getStaticData ( ) . setvmt_guid ( new org.ovirt.engine.core.compat.Guid ( node.InnerText ) ) ; } } node = content.SelectSingleNode ( "TemplateName" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setvmt_name ( node.InnerText ) ; } } node = content.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vm.getStaticData ( ) . setdescription ( node.InnerText ) ; } node = content.SelectSingleNode ( "Domain" ) ; if ( node != null ) { _vm.getStaticData ( ) . setdomain ( node.InnerText ) ; } node = content.SelectSingleNode ( "CreationDate" ) ; final java.util.Date creationDate = org.ovirt.engine.core.utils.ovf.OvfParser.UtcDateStringToLocaDate ( node.InnerText ) ; if ( creationDate != null ) { _vm.getStaticData ( ) . setcreation_date ( creationDate ) ; } node = content.SelectSingleNode ( "ExportDate" ) ; if ( node != null ) { final java.util.Date exportDate = org.ovirt.engine.core.utils.ovf.OvfParser.UtcDateStringToLocaDate ( node.InnerText ) ; if ( exportDate != null ) { _vm.getStaticData ( ) . setExportDate ( exportDate ) ; } } node = content.SelectSingleNode ( "IsInitilized" ) ; if ( node != null ) { _vm.getStaticData ( ) . setis_initialized ( java.lang.Boolean.parseBoolean ( node.InnerText ) ) ; } node = content.SelectSingleNode ( "IsAutoSuspend" ) ; if ( node != null ) { _vm.getStaticData ( ) . setis_auto_suspend ( java.lang.Boolean.parseBoolean ( node.InnerText ) ) ; } node = content.SelectSingleNode ( "TimeZone" ) ; if ( node != null ) { _vm.getStaticData ( ) . settime_zone ( node.InnerText ) ; } node = content.SelectSingleNode ( "IsStateless" ) ; if ( node != null ) { _vm.getStaticData ( ) . setis_stateless ( java.lang.Boolean.parseBoolean ( node.InnerText ) ) ; } org.ovirt.engine.core.compat.backendcompat.XmlNodeList list = content.SelectNodes ( "Section" ) ; for ( org.ovirt.engine.core.compat.backendcompat.XmlNode section : list ) { java.lang.String value = section.Attributes.get ( "xsi:type" ) . getValue ( ) ; if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( value , "ovf:OperatingSystemSection_Type" ) ) { ReadOsSection ( section ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.EqOp ( value , "ovf:VirtualHardwareSection_Type" ) ) { ReadHardwareSection ( section ) ; } else if ( org.apache.commons.lang.StringUtils.equals ( value , "ovf:SnapshotsSection_Type" ) ) { readSnapshotsSection ( section ) ; } } node = content.SelectSingleNode ( "Origin" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setorigin ( org.ovirt.engine.core.common.businessentities.OriginType.forValue ( java.lang.Integer.parseInt ( node.InnerText ) ) ) ; } } node = content.SelectSingleNode ( "initrd_url" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setinitrd_url ( node.InnerText ) ; } } node = content.SelectSingleNode ( "default_boot_sequence" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setdefault_boot_sequence ( org.ovirt.engine.core.common.businessentities.BootSequence.forValue ( java.lang.Integer.parseInt ( node.InnerText ) ) ) ; } } node = content.SelectSingleNode ( "kernel_url" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setkernel_url ( node.InnerText ) ; } } node = content.SelectSingleNode ( "kernel_params" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setkernel_params ( node.InnerText ) ; } } org.ovirt.engine.core.utils.ovf.OvfLogEventHandler < org.ovirt.engine.core.common.businessentities.VmStatic > handler = new org.ovirt.engine.core.utils.ovf.VMStaticOvfLogHandler ( _vm.getStaticData ( ) ) ; java.util.List < java.lang.String > aliases = handler.getAliases ( ) ; for ( java.lang.String alias : aliases ) { java.lang.String value = readEventLogValue ( content , alias ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( value ) ) ) { handler.addValueForAlias ( alias , value ) ; } } node = content.SelectSingleNode ( "app_list" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setapp_list ( node.InnerText ) ; } } else if ( ( ( _images ) != null ) && ( ( _images.size ( ) ) > 0 ) ) { int root = org.ovirt.engine.core.utils.ovf.OvfVmReader.GetFirstImage ( _images , _images.get ( 0 ) ) ; if ( root != ( - 1 ) ) { for ( int i = 0 ; i < ( _images.size ( ) ) ; i ++ ) { int x = org.ovirt.engine.core.utils.ovf.OvfVmReader.GetNextImage ( _images , _images.get ( i ) ) ; if ( x == ( - 1 ) ) { _vm.setapp_list ( _images.get ( i ) . getappList ( ) ) ; } } } else { _vm.setapp_list ( _images.get ( 0 ) . getappList ( ) ) ; } } node = content.SelectSingleNode ( "VmType" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setvm_type ( org.ovirt.engine.core.common.businessentities.VmType.forValue ( java.lang.Integer.parseInt ( node.InnerText ) ) ) ; } } node = content.SelectSingleNode ( "DefaultDisplayType" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setdefault_display_type ( org.ovirt.engine.core.common.businessentities.DisplayType.forValue ( java.lang.Integer.parseInt ( node.InnerText ) ) ) ; } } node = content.SelectSingleNode ( "MinAllocatedMem" ) ; if ( node != null ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( node.InnerText ) ) ) { _vm.setMinAllocatedMem ( java.lang.Integer.parseInt ( node.InnerText ) ) ; } } }