/// <summary> /// Build <see cref="ReportingTaxonomyType"/> from <paramref name="buildFrom"/>. /// </summary> /// <param name="buildFrom"> /// The build from. /// </param> /// <returns> /// The <see cref="ReportingTaxonomyType"/> from <paramref name="buildFrom"/> . /// </returns> public ReportingTaxonomyType Build(IReportingTaxonomyObject buildFrom) { var builtObj = new ReportingTaxonomyType(); // MAINTAINABLE ATTRIBUTES string str0 = buildFrom.AgencyId; if (!string.IsNullOrWhiteSpace(str0)) { builtObj.agencyID = buildFrom.AgencyId; } string str1 = buildFrom.Id; if (!string.IsNullOrWhiteSpace(str1)) { builtObj.id = buildFrom.Id; } if (buildFrom.Uri != null) { builtObj.uri = buildFrom.Uri; } builtObj.urn = buildFrom.Urn; string str3 = buildFrom.Version; if (!string.IsNullOrWhiteSpace(str3)) { builtObj.version = buildFrom.Version; } if (buildFrom.StartDate != null) { builtObj.validFrom = buildFrom.StartDate.Date; } if (buildFrom.EndDate != null) { builtObj.validTo = buildFrom.EndDate.Date; } IList<ITextTypeWrapper> names = buildFrom.Names; if (ObjectUtil.ValidCollection(names)) { builtObj.Name = this.GetTextType(names); } IList<ITextTypeWrapper> descriptions = buildFrom.Descriptions; if (ObjectUtil.ValidCollection(descriptions)) { builtObj.Description = this.GetTextType(descriptions); } if (this.HasAnnotations(buildFrom)) { builtObj.Annotations = this.GetAnnotationsType(buildFrom); } if (buildFrom.IsExternalReference.IsSet()) { builtObj.isExternalReference = buildFrom.IsExternalReference.IsTrue; } if (buildFrom.IsFinal.IsSet()) { builtObj.isFinal = buildFrom.IsFinal.IsTrue; } // CATEGORIES foreach (IReportingCategoryObject categoryBean in buildFrom.Items) { builtObj.Category.Add(this._categoryXmlBuilder.Build(categoryBean)); } return builtObj; }
public StructuresType(ProvisionAgreementType provisionAgreement, ConstraintType constraint, ProcessType process, ReportingTaxonomyType reportingTaxonomoy, StructureSetType structureSet, DataStructureType dataStructure, MetadataStructureType metadataStructure, ConceptSchemeType conceptScheme, HierarchicalCodelistType hierarchicalCodelist, CodelistType codelist, CategorisationType categorisation, CategorySchemeType categoryScheme, MetadataflowType metadataFlow, DataflowType dataFlow, OrganisationSchemeType organisationScheme) { if (provisionAgreement != null) { this.provisionAgreementsField = new List<ProvisionAgreementType>(); this.provisionAgreementsField.Add(provisionAgreement); } if (constraint != null) { this.constraintsField = new List<ConstraintType>(); this.constraintsField.Add(constraint); } if (process != null) { this.processesField = new List<ProcessType>(); this.processesField.Add(process); } if (reportingTaxonomoy != null) { this.reportingTaxonomiesField = new List<ReportingTaxonomyType>(); this.reportingTaxonomiesField.Add(reportingTaxonomoy); } if (structureSet != null) { this.structureSetsField = new List<StructureSetType>(); this.structureSetsField.Add(structureSet); } if (dataStructure != null) { this.dataStructuresField = new List<DataStructureType>(); this.dataStructuresField.Add(dataStructure); } if (metadataStructure != null) { this.metadataStructuresField = new List<MetadataStructureType>(); this.metadataStructuresField.Add(metadataStructure); } if (conceptScheme != null) { this.conceptsField = new List<ConceptSchemeType>(); this.conceptsField.Add(conceptScheme); } if (hierarchicalCodelist != null) { this.hierarchicalCodelistsField = new List<HierarchicalCodelistType>(); this.hierarchicalCodelistsField.Add(hierarchicalCodelist); } if (codelist != null) { this.codelistsField = new List<CodelistType>(); this.codelistsField.Add(codelist); } if (categorisation != null) { this.categorisationsField = new List<CategorisationType>(); this.categorisationsField.Add(categorisation); } if (categoryScheme != null) { this.categorySchemesField = new List<CategorySchemeType>(); this.categorySchemesField.Add(categoryScheme); } if (metadataFlow != null) { this.metadataflowsField = new List<MetadataflowType>(); this.metadataflowsField.Add(metadataFlow); } if (dataFlow != null) { this.dataflowsField = new List<DataflowType>(); this.dataflowsField.Add(dataFlow); } if (organisationScheme != null) { this.organisationSchemesField = new List<OrganisationSchemeType>(); this.organisationSchemesField.Add(organisationScheme); } }