/////////////////////////////////////////////////////////////////////////////////////////////////// ////////////BUILD FROM MUTABLE OBJECTS ////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////// #region Constructors and Destructors /// <summary> /// Initializes a new instance of the <see cref="IdentifiableTargetCore"/> class. /// </summary> /// <param name="itemMutableObject"> /// The sdmxObject. /// </param> /// <param name="parent"> /// The parent. /// </param> /// <exception cref="SdmxSemmanticException"> /// Throws Validate exception. /// </exception> public IdentifiableTargetCore(IIdentifiableTargetMutableObject itemMutableObject, IMetadataTarget parent) : base(itemMutableObject, parent, false) { this.referencedStructureType = itemMutableObject.ReferencedStructureType; try { this.Validate(); } catch (SdmxSemmanticException e) { throw new SdmxSemmanticException(e, ExceptionCode.FailValidation, this); } }
/// <summary> /// Handles the child elements. /// </summary> /// <param name="parent">The parent.</param> /// <param name="elementLocalName">Name of the element local.</param> /// <returns>The <see cref="StructureReaderBaseV20.ElementActions"/></returns> private ElementActions HandleChildElements(IIdentifiableTargetMutableObject parent, object elementLocalName) { if (NameTableCache.IsElement(elementLocalName, ElementNameTable.RepresentationScheme)) { string id = Helper.TrySetFromAttribute(this.Attributes, AttributeNameTable.representationScheme, (string)null); string agency = Helper.TrySetFromAttribute(this.Attributes, AttributeNameTable.representationSchemeAgency, (string)null); string version = Helper.TrySetFromAttribute(this.Attributes, AttributeNameTable.representationSchemeVersion, (string)null); string type = Helper.TrySetFromAttribute(this.Attributes, AttributeNameTable.representationSchemeType, (string)null); var structureType = XmlobjectsEnumUtil.GetSdmxStructureTypeFromRepresentationSchemeTypeV20(type); if (parent.Representation == null) { parent.Representation = new RepresentationMutableCore(); } parent.Representation.Representation = new StructureReferenceImpl(agency, id, version, structureType); } return null; }
/// <summary> /// Handles the text child element. /// </summary> /// <param name="parent">The parent.</param> /// <param name="elementLocalName">Name of the element local.</param> private void HandleTextChildElement(IIdentifiableTargetMutableObject parent, object elementLocalName) { if (NameTableCache.IsElement(elementLocalName, ElementNameTable.TargetObjectClass)) { parent.ReferencedStructureType = XmlobjectsEnumUtil.GetSdmxStructureType(this.Text); } }