コード例 #1
0
ファイル: ItemMapCore.cs プロジェクト: alcardac/SDMXRI_WS_OF
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2.1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="ItemMapCore"/> class.
        /// </summary>
        /// <param name="id">
        /// The id. 
        /// </param>
        /// <param name="target">
        /// The target. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public ItemMapCore(string id, string target, ISdmxStructure parent)
            : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.ItemMap), parent)
        {
            this.sourceId = id;
            this.targetId = target;
            this.Validate();
        }
コード例 #2
0
ファイル: ItemMapCore.cs プロジェクト: alcardac/SDMXRI_WS_OF
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECTS             //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ItemMapCore"/> class.
        /// </summary>
        /// <param name="itemMapMutableObject">
        /// The agencyScheme. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public ItemMapCore(IItemMapMutableObject itemMapMutableObject, ISdmxStructure parent)
            : base(itemMapMutableObject, parent)
        {
            this.sourceId = itemMapMutableObject.SourceId;
            this.targetId = itemMapMutableObject.TargetId;
            this.Validate();
        }
コード例 #3
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECTS              //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="DataSourceCore"/> class.
        /// </summary>
        /// <param name="datasource">
        /// The datasource. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public DataSourceCore(IDataSourceMutableObject datasource, ISdmxStructure parent)
            : base(datasource, parent)
        {
            this._dataUrl = datasource.DataUrl;
            this._wsdlUrl = datasource.WSDLUrl;
            this._isRestDatasource = datasource.RESTDatasource;
            this._isSimpleDatasource = datasource.SimpleDatasource;
            this._isWebServiceDatasource = datasource.WebServiceDatasource;
            this.Validate();
        }
コード例 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CodelistRefCore"/> class.
        /// </summary>
        /// <param name="codelistRefMutableObject">
        /// The sdmxObject. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public CodelistRefCore(ICodelistRefMutableObject codelistRefMutableObject, ISdmxStructure parent)
            : base(codelistRefMutableObject, parent)
        {
            this.alias = codelistRefMutableObject.Alias;
            if (codelistRefMutableObject.CodelistReference != null)
            {
                this.codelistReference = new CrossReferenceImpl(this, codelistRefMutableObject.CodelistReference);
            }

            this.Validate();
        }
コード例 #5
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECT                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////    

        /// <summary>
        ///   Initializes a new instance of the <see cref="AnnotableCore" /> class.
        /// </summary>
        /// <param name="mutableObject"> The mutable object. </param>
        /// <param name="parent"> The parent. </param>
        protected internal AnnotableCore(IAnnotableMutableObject mutableObject, ISdmxStructure parent)
            : base(mutableObject, parent)
        {
            this.annotations = new List<IAnnotation>();
            if (mutableObject != null && mutableObject.Annotations != null)
            {
                foreach (IAnnotationMutableObject currentAnnotation in mutableObject.Annotations)
                {
                    this.annotations.Add(new AnnotationObjectCore(currentAnnotation, this));
                }
            }
        }
コード例 #6
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECTS              //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="GroupCore"/> class.
        /// </summary>
        /// <param name="itemMutableObject">
        /// The agencyScheme. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public GroupCore(IGroupMutableObject itemMutableObject, ISdmxStructure parent)
            : base(itemMutableObject, parent)
        {
            this.dimensionRef = new List<string>();
            if (itemMutableObject.AttachmentConstraintRef != null)
            {
                this.attachmentConstraintRef = new CrossReferenceImpl(this, itemMutableObject.AttachmentConstraintRef);
            }

            if (itemMutableObject.DimensionRef != null)
            {
                this.dimensionRef = new List<string>(itemMutableObject.DimensionRef);
            }

            this.ValidateGroupAttributes();
        }
コード例 #7
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECT                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="TimeRangeCore"/> class.
        /// </summary>
        /// <param name="mutable">
        /// The mutable. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public TimeRangeCore(ITimeRangeMutableObject mutable, ISdmxStructure parent)
            : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.TimeRange), parent)
        {
            if (mutable.StartDate != null)
            {
                this._startDate = new SdmxDateCore(mutable.StartDate, TimeFormatEnumType.DateTime);
            }

            if (mutable.EndDate != null)
            {
                this._endDate = new SdmxDateCore(mutable.EndDate, TimeFormatEnumType.DateTime);
            }

            this._isRange = mutable.IsRange;
            this._isStartInclusive = mutable.IsStartInclusive;
            this._isEndInclusive = mutable.IsEndInclusive;
        }
コード例 #8
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECTS             //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="CategoryMapCore"/> class.
        /// </summary>
        /// <param name="categoryMapMutable"> Category Map object
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        protected internal CategoryMapCore(ICategoryMapMutableObject categoryMapMutable, ISdmxStructure parent)
            : base(categoryMapMutable, parent)
        {
            this.sourceId = new List<string>();
            this.targetId = new List<string>();
            this.alias = categoryMapMutable.Alias;
            if (categoryMapMutable.SourceId != null)
            {
                this.sourceId = new List<string>(categoryMapMutable.SourceId);
            }

            if (categoryMapMutable.TargetId != null)
            {
                this.targetId = new List<string>(categoryMapMutable.TargetId);
            }

            this.Validate();
        }
コード例 #9
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECT                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="KeyValuesCore"/> class.
        /// </summary>
        /// <param name="mutable">
        /// The mutable. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public KeyValuesCore(IKeyValuesMutable mutable, ISdmxStructure parent)
            : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.KeyValues), parent)
        {
            this.values = new List<string>();
            this.caseCadeList = new List<string>();
            this.id = mutable.Id;
            this.values.AddRange(mutable.KeyValues);

            foreach (string value in this.values)
            {
                if (mutable.IsCascadeValue(value))
                {
                    this.caseCadeList.Add(value);
                }
            }

            if (mutable.TimeRange != null)
            {
                this.timeRange = new TimeRangeCore(mutable.TimeRange, this);
            }
            Validate();
        }
コード例 #10
0
		///////////////////////////////////////////////////////////////////////////////////////////////////
		////////////BUILD FROM V1 SCHEMA                 //////////////////////////////////////////////////
		///////////////////////////////////////////////////////////////////////////////////////////////////

		/// <summary>
		/// Initializes a new instance of the <see cref="ComponentCore"/> class.
		/// </summary>
		/// <param name="createdFrom">
		/// The created from. 
		/// </param>
		/// <param name="structureType">
		/// The structure type. 
		/// </param>
		/// <param name="annotationType">
		/// The annotation type. 
		/// </param>
		/// <param name="codelistId">
		/// The codelist id. 
		/// </param>
		/// <param name="conceptId">
		/// The concept id. 
		/// </param>
		/// <param name="parent">
		/// The parent. 
		/// </param>
		protected internal ComponentCore(
			IXmlSerializable createdFrom, 
			SdmxStructureType structureType, 
			Org.Sdmx.Resources.SdmxMl.Schemas.V10.common.AnnotationsType annotationType, 
			string codelistId, 
			string conceptId, 
			ISdmxStructure parent)
			: base(createdFrom, structureType, conceptId, null, annotationType, parent)
		{
			if (!string.IsNullOrWhiteSpace(codelistId))
			{
				this.LocalRepresentation = new RepresentationCore(codelistId, this);
			}

			this._conceptRef = new CrossReferenceImpl(
				this, 
				this.MaintainableParent.AgencyId, 
				ConceptSchemeObject.DefaultSchemeVersion, 
				ConceptSchemeObject.DefaultSchemeVersion, 
				SdmxStructureEnumType.Concept, 
				conceptId);
			this.ValidateComponentAttributes();
		}
コード例 #11
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECTS             //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="ComponentMapCore"/> class.
        /// </summary>
        /// <param name="compMap">
        /// The comp map. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        /// <exception cref="SdmxSemmanticException">
        /// Throws Validate exception.
        /// </exception>
        protected internal ComponentMapCore(IComponentMapMutableObject compMap, ISdmxStructure parent)
            : base(compMap, parent)
        {
            if (compMap.MapConceptRef != null)
            {
                this.mapConceptRef = compMap.MapConceptRef;
            }

            if (compMap.MapTargetConceptRef != null)
            {
                this.mapTargetConceptRef = compMap.MapTargetConceptRef;
            }

            if (compMap.RepMapRef != null)
            {
                this.repMapRef = new RepresentationMapRefCore(compMap.RepMapRef, this);
            }

            try
            {
                this.Validate();
            }
            catch (SdmxSemmanticException e)
            {
                throw new SdmxSemmanticException(e, ExceptionCode.FailValidation, this);
            }
        }
コード例 #12
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="TransitionCore"/> class.
        /// </summary>
        /// <param name="trans">
        /// The trans. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public TransitionCore(
            Org.Sdmx.Resources.SdmxMl.Schemas.V20.structure.TransitionType trans, ISdmxStructure parent)
            : base(GenerateId(), SdmxStructureType.GetFromEnum(SdmxStructureEnumType.Transition), parent)
        {
            this.condition = new List<ITextTypeWrapper>();
            this.targetStep = trans.TargetStep;
            if (trans.Condition != null)
            {
                this.condition.Add(new TextTypeWrapperImpl(trans.Condition, this));
            }
        }
コード例 #13
0
        private IProcessStepObject processStep; // Referenced from targetStep

        #endregion

        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECTS              //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="TransitionCore"/> class.
        /// </summary>
        /// <param name="itemMutableObject">
        /// The sdmxObject. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public TransitionCore(ITransitionMutableObject itemMutableObject, ISdmxStructure parent)
            : base(itemMutableObject, parent)
        {
            this.condition = new List<ITextTypeWrapper>();
            this.targetStep = itemMutableObject.TargetStep;
            if (itemMutableObject.Conditions != null)
            {
                foreach (ITextTypeWrapperMutableObject textTypeWrapperMutableObject in itemMutableObject.Conditions)
                {
                    if (!string.IsNullOrWhiteSpace(textTypeWrapperMutableObject.Value))
                    {
                        this.condition.Add(new TextTypeWrapperImpl(textTypeWrapperMutableObject, this));
                    }
                }
            }

            this.localId = itemMutableObject.LocalId;
            this.Validate();
        }
コード例 #14
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="GroupCore"/> class.
        /// </summary>
        /// <param name="group">
        /// The group. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public GroupCore(Org.Sdmx.Resources.SdmxMl.Schemas.V10.structure.GroupType group, ISdmxStructure parent)
            : base(
                group, 
                SdmxStructureType.GetFromEnum(SdmxStructureEnumType.Group), 
                group.id, 
                null, 
                group.Annotations, 
                parent)
        {
            this.dimensionRef = new List<string>();
            if (group.DimensionRef != null)
            {
                this.dimensionRef = new List<string>(group.DimensionRef);
            }

            this.ValidateGroupAttributes();
        }
コード例 #15
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2.1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="TransitionCore"/> class.
        /// </summary>
        /// <param name="transition">
        /// The transition. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public TransitionCore(TransitionType transition, ISdmxStructure parent)
            : base(transition, SdmxStructureType.GetFromEnum(SdmxStructureEnumType.Transition), parent)
        {
            this.condition = new List<ITextTypeWrapper>();
            if (transition.TargetStep != null)
            {
                this.targetStep = RefUtil.CreateLocalIdReference(transition.TargetStep);
            }

            if (transition.Condition != null)
            {
                this.condition = TextTypeUtil.WrapTextTypeV21(transition.Condition, this);
            }

            this.localId = transition.localID;
            this.Validate();
        }
コード例 #16
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2.1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="CategoryMapCore"/> class.
        /// </summary>
        /// <param name="catType">
        /// The cat type. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        protected internal CategoryMapCore(CategoryMapType catType, ISdmxStructure parent)
            : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.CategoryMap), parent)
        {
            this.sourceId = new List<string>();
            this.targetId = new List<string>();

            // FUNC 2.1 - this referernce is wrong as it only allows for a single id
            this.Validate();
        }
 /// <summary>
 /// The create immutable instance.
 /// </summary>
 /// <param name="parent">
 /// The parent. 
 /// </param>
 /// <returns>
 /// The <see cref="ITimeRange"/> . 
 /// </returns>
 public virtual ITimeRange CreateImmutableInstance(ISdmxStructure parent)
 {
     return new TimeRangeCore(this, parent);
 }
コード例 #18
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2.1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="KeyValuesCore"/> class.
        /// </summary>
        /// <param name="keyValueType">
        /// The key value type. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public KeyValuesCore(ComponentValueSetType keyValueType, ISdmxStructure parent)
            : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.KeyValues), parent)
        {
            this.values = new List<string>();
            this.caseCadeList = new List<string>();

            this.id = keyValueType.id;

            if (keyValueType.Value != null)
            {
                foreach (SimpleValueType dataKeyType in keyValueType.Value)
                {
                    this.values.Add(dataKeyType.TypedValue);
                    if (dataKeyType.cascadeValues)
                    {
                        this.caseCadeList.Add(dataKeyType.TypedValue);
                    }
                }
            }

            if (keyValueType.TimeRange != null)
            {
                this.timeRange = new TimeRangeCore(keyValueType.TimeRange, this);
            }
            Validate();
        }
コード例 #19
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="IdentifiableCore"/> class.
        /// </summary>
        /// <param name="createdFrom">
        /// The created from.
        /// </param>
        /// <param name="structureType">
        /// The structure type.
        /// </param>
        /// <param name="id0">
        /// The id 0.
        /// </param>
        /// <param name="uri1">
        /// The uri 1.
        /// </param>
        /// <param name="annotationsType">
        /// The annotations type.
        /// </param>
        /// <param name="parent">
        /// The parent.
        /// </param>
        protected IdentifiableCore(
            IXmlSerializable createdFrom, SdmxStructureType structureType, string id0, Uri uri1, Org.Sdmx.Resources.SdmxMl.Schemas.V10.common.AnnotationsType annotationsType, ISdmxStructure parent)
            : base(createdFrom, annotationsType, structureType, parent)
        {
            this._id = id0;
            this.Uri = uri1;
            this.ValidateIdentifiableAttributes();
        }
コード例 #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SdmxStructureCore"/> class.
 /// </summary>
 /// <param name="agencyScheme">
 /// The agencyScheme. 
 /// </param>
 protected internal SdmxStructureCore(ISdmxStructure agencyScheme)
     : base(agencyScheme)
 {
     this.StructureType = agencyScheme.StructureType;
     this._parent = agencyScheme.Parent;
 }
コード例 #21
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM ITSELF, CREATES STUB OBJECT //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////    
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="SdmxStructureCore"/> class.
        /// </summary>
        /// <param name="structureType">
        /// The structure type. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        protected internal SdmxStructureCore(SdmxStructureType structureType, ISdmxStructure parent)
            : base(structureType, parent)
        {
            this.StructureType = structureType;
            this._parent = parent;
        }
コード例 #22
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECT                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="SdmxStructureCore"/> class.
        /// </summary>
        /// <param name="mutableObject">
        /// The mutable object. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        protected SdmxStructureCore(IMutableObject mutableObject, ISdmxStructure parent)
            : base(mutableObject, parent)
        {
            this._parent = parent;
        }
コード例 #23
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="CategoryMapCore"/> class.
        /// </summary>
        /// <param name="catType">
        /// The cat type. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        protected internal CategoryMapCore(
            Org.Sdmx.Resources.SdmxMl.Schemas.V20.structure.CategoryMapType catType, ISdmxStructure parent)
            : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.CategoryMap), parent)
        {
            this.sourceId = new List<string>();
            this.targetId = new List<string>();
            this.alias = catType.categoryAlias;
            PopulateCategoryIdList(this.sourceId, catType.CategoryID);
            PopulateCategoryIdList(this.targetId, catType.TargetCategoryID);
            this.Validate();
        }
コード例 #24
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////    

        /// <summary>
        ///   Initializes a new instance of the <see cref="AnnotableCore" /> class.
        /// </summary>
        /// <param name="createdFrom"> The created from. </param>
        /// <param name="annotationType"> The annotation type. </param>
        /// <param name="structureType"> The structure type. </param>
        /// <param name="parent"> The parent. </param>
        protected internal AnnotableCore(
            IXmlSerializable createdFrom,
            Org.Sdmx.Resources.SdmxMl.Schemas.V10.common.AnnotationsType annotationType,
            SdmxStructureType structureType,
            ISdmxStructure parent)
            : base(structureType, parent)
        {
            this.annotations = new List<IAnnotation>();
            if (annotationType != null && annotationType.Annotation != null)
            {
                foreach (Org.Sdmx.Resources.SdmxMl.Schemas.V10.common.AnnotationType currentAnnotation in
                    annotationType.Annotation)
                {
                    this.annotations.Add(new AnnotationObjectCore(currentAnnotation, this));
                }
            }
        }
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM MUTABLE OBJECTS             //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        #region Constructors and Destructors

        /// <summary>
        /// Initializes a new instance of the <see cref="RelatedStructuresCore"/> class.
        /// </summary>
        /// <param name="relatedStructuresMutableObject">
        /// The sdmxObject. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public RelatedStructuresCore(IRelatedStructuresMutableObject relatedStructuresMutableObject, ISdmxStructure parent)
            : base(relatedStructuresMutableObject, parent)
        {
            this._keyFamilyRef = new List<ICrossReference>();
            this._metadataStructureRef = new List<ICrossReference>();
            this._conceptSchemeRef = new List<ICrossReference>();
            this._categorySchemeRef = new List<ICrossReference>();
            this._orgSchemeRef = new List<ICrossReference>();
            this._hierCodelistRef = new List<ICrossReference>();
            this._keyFamilyRef = this.CreateCrossReferenceList(relatedStructuresMutableObject.DataStructureRef);
            this._metadataStructureRef = this.CreateCrossReferenceList(relatedStructuresMutableObject.MetadataStructureRef);
            this._conceptSchemeRef = this.CreateCrossReferenceList(relatedStructuresMutableObject.ConceptSchemeRef);
            this._categorySchemeRef = this.CreateCrossReferenceList(relatedStructuresMutableObject.CategorySchemeRef);
            this._orgSchemeRef = this.CreateCrossReferenceList(relatedStructuresMutableObject.OrgSchemeRef);
            this._hierCodelistRef = this.CreateCrossReferenceList(relatedStructuresMutableObject.HierCodelistRef);
        }
コード例 #26
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2.1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="GroupCore"/> class.
        /// </summary>
        /// <param name="group">
        /// The group. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public GroupCore(GroupType group, ISdmxStructure parent)
            : base(group, SdmxStructureType.GetFromEnum(SdmxStructureEnumType.Group), parent)
        {
            this.dimensionRef = new List<string>();
            if (group.AttachmentConstraint != null)
            {
                this.attachmentConstraintRef = RefUtil.CreateReference(this, group.AttachmentConstraint);
            }

            if (group.GroupDimension != null)
            {
                this.dimensionRef = new List<string>();
                foreach (GroupDimension each in group.GroupDimension)
                {
                    this.dimensionRef.Add(RefUtil.CreateLocalIdReference(each.DimensionReference));
                }
            }

            this.ValidateGroupAttributes();
        }
コード例 #27
0
        // ///////////////////////////////////////////////////////////////////////////////////////////////////
        // ////////////BUILD FROM READER                    //////////////////////////////////////////////////
        // ///////////////////////////////////////////////////////////////////////////////////////////////////    
        // public AnnotableCore(SdmxStructureType structure, SdmxReader reader, ISdmxStructure parent) {
        // super(structure, parent);
        // string currentElement = reader.getCurrentElement();
        // if(reader.peek().equals("Annotations")) {
        // reader.moveNextElement();
        // while(reader.peek().equals("Annotation")) {
        // reader.moveNextElement();
        // annotations.add(new AnnotationObjectCore(reader, this));
        // }
        // reader.moveBackToElement(currentElement);
        // }
        // }

        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2.1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////    

        /// <summary>
        ///   Initializes a new instance of the <see cref="AnnotableCore" /> class.
        /// </summary>
        /// <param name="createdFrom"> The created from. </param>
        /// <param name="structureType"> The structure type. </param>
        /// <param name="parent"> The parent. </param>
        protected internal AnnotableCore(
            AnnotableType createdFrom, SdmxStructureType structureType, ISdmxStructure parent)
            : base(structureType, parent)
        {
            this.annotations = new List<IAnnotation>();
            if (createdFrom != null)
            {
                Annotations annotations1 = createdFrom.Annotations;
                if (annotations1 != null && annotations1.Annotation != null)
                {
                    IList<AnnotationType> annotationType = annotations1.Annotation;
                    if (annotationType != null)
                    {
                        foreach (AnnotationType currentAnnotation in annotationType)
                        {
                            this.annotations.Add(new AnnotationObjectCore(currentAnnotation, this));
                        }
                    }
                }
            }
        }
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2.1 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="RelatedStructuresCore"/> class.
        /// </summary>
        /// <param name="relStrucTypeList">
        /// The rel struc type list. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        /// <exception cref="SdmxSemmanticException">
        /// Throws Validate exception.
        /// </exception>
        public RelatedStructuresCore(IList<StructureOrUsageReferenceType> relStrucTypeList, ISdmxStructure parent)
            : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.RelatedStructures), parent)
        {
            this._keyFamilyRef = new List<ICrossReference>();
            this._metadataStructureRef = new List<ICrossReference>();
            this._conceptSchemeRef = new List<ICrossReference>();
            this._categorySchemeRef = new List<ICrossReference>();
            this._orgSchemeRef = new List<ICrossReference>();
            this._hierCodelistRef = new List<ICrossReference>();

            foreach (StructureOrUsageReferenceType relStrucType in relStrucTypeList)
            {
                ICrossReference structureReference = RefUtil.CreateReference(this, relStrucType);
                switch (structureReference.TargetReference.EnumType)
                {
                    case SdmxStructureEnumType.Dsd:
                        this._keyFamilyRef.Add(structureReference);
                        break;
                    case SdmxStructureEnumType.Msd:
                        this._metadataStructureRef.Add(structureReference);
                        break;
                    case SdmxStructureEnumType.ConceptScheme:
                        this._conceptSchemeRef.Add(structureReference);
                        break;
                    case SdmxStructureEnumType.CategoryScheme:
                        this._categorySchemeRef.Add(structureReference);
                        break;
                    case SdmxStructureEnumType.OrganisationUnitScheme:
                        this._orgSchemeRef.Add(structureReference);
                        break;
                    case SdmxStructureEnumType.HierarchicalCodelist:
                        this._hierCodelistRef.Add(structureReference);
                        break;
                    default:
                        throw new SdmxSemmanticException(
                            "IRelatedStructures can not reference : " + structureReference.TargetReference.GetType());
                }
            }
        }
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="RelatedStructuresCore"/> class.
        /// </summary>
        /// <param name="relStrucType">
        /// The rel struc type. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public RelatedStructuresCore(RelatedStructuresType relStrucType, ISdmxStructure parent)
            : base(SdmxStructureType.GetFromEnum(SdmxStructureEnumType.RelatedStructures), parent)
        {
            this._keyFamilyRef = new List<ICrossReference>();
            this._metadataStructureRef = new List<ICrossReference>();
            this._conceptSchemeRef = new List<ICrossReference>();
            this._categorySchemeRef = new List<ICrossReference>();
            this._orgSchemeRef = new List<ICrossReference>();
            this._hierCodelistRef = new List<ICrossReference>();

            // get list of key family ref
            if (relStrucType.KeyFamilyRef != null)
            {
                foreach (KeyFamilyRefType keyFam in relStrucType.KeyFamilyRef)
                {
                    if (keyFam.URN != null)
                    {
                        this._keyFamilyRef.Add(new CrossReferenceImpl(this, keyFam.URN));
                    }
                    else
                    {
                        this._keyFamilyRef.Add(
                            new CrossReferenceImpl(
                                this, 
                                keyFam.KeyFamilyAgencyID, 
                                keyFam.KeyFamilyID, 
                                keyFam.Version, 
                                SdmxStructureType.GetFromEnum(SdmxStructureEnumType.Dsd)));
                    }
                }
            }

            // get list of metadata structure ref
            if (relStrucType.MetadataStructureRef != null)
            {
                foreach (MetadataStructureRefType metStruc in relStrucType.MetadataStructureRef)
                {
                    if (metStruc.URN != null)
                    {
                        this._metadataStructureRef.Add(new CrossReferenceImpl(this, metStruc.URN));
                    }
                    else
                    {
                        this._metadataStructureRef.Add(
                            new CrossReferenceImpl(
                                this, 
                                metStruc.MetadataStructureAgencyID, 
                                metStruc.MetadataStructureID, 
                                metStruc.Version, 
                                SdmxStructureType.GetFromEnum(SdmxStructureEnumType.Msd)));
                    }
                }
            }

            // get list of concept scheme ref
            if (relStrucType.ConceptSchemeRef != null)
            {
                foreach (ConceptSchemeRefType conStruc in relStrucType.ConceptSchemeRef)
                {
                    if (conStruc.URN != null)
                    {
                        this._conceptSchemeRef.Add(new CrossReferenceImpl(this, conStruc.URN));
                    }
                    else
                    {
                        this._conceptSchemeRef.Add(
                            new CrossReferenceImpl(
                                this, 
                                conStruc.AgencyID, 
                                conStruc.ConceptSchemeID, 
                                conStruc.Version, 
                                SdmxStructureType.GetFromEnum(SdmxStructureEnumType.ConceptScheme)));
                    }
                }
            }

            // get list of category scheme ref
            if (relStrucType.CategorySchemeRef != null)
            {
                foreach (CategorySchemeRefType catStruc in relStrucType.CategorySchemeRef)
                {
                    if (catStruc.URN != null)
                    {
                        this._categorySchemeRef.Add(new CrossReferenceImpl(this, catStruc.URN));
                    }
                    else
                    {
                        this._categorySchemeRef.Add(
                            new CrossReferenceImpl(
                                this, 
                                catStruc.AgencyID, 
                                catStruc.CategorySchemeID, 
                                catStruc.Version, 
                                SdmxStructureType.GetFromEnum(SdmxStructureEnumType.CategoryScheme)));
                    }
                }
            }

            // get list of organisation scheme ref
            if (relStrucType.OrganisationSchemeRef != null)
            {
                foreach (OrganisationSchemeRefType orgScheme in relStrucType.OrganisationSchemeRef)
                {
                    if (orgScheme.URN != null)
                    {
                        this._orgSchemeRef.Add(new CrossReferenceImpl(this, orgScheme.URN));
                    }
                    else
                    {
                        this._orgSchemeRef.Add(
                            new CrossReferenceImpl(
                                this, 
                                orgScheme.AgencyID, 
                                orgScheme.OrganisationSchemeID, 
                                orgScheme.Version, 
                                SdmxStructureType.GetFromEnum(SdmxStructureEnumType.OrganisationUnitScheme)));
                    }
                }
            }

            // get list of hierarchical codelist ref
            if (relStrucType.HierarchicalCodelistRef != null)
            {
                foreach (HierarchicalCodelistRefType hierCode in relStrucType.HierarchicalCodelistRef)
                {
                    if (hierCode.URN != null)
                    {
                        this._hierCodelistRef.Add(new CrossReferenceImpl(this, hierCode.URN));
                    }
                    else
                    {
                        this._hierCodelistRef.Add(
                            new CrossReferenceImpl(
                                this, 
                                hierCode.AgencyID, 
                                hierCode.HierarchicalCodelistID, 
                                hierCode.Version, 
                                SdmxStructureType.GetFromEnum(SdmxStructureEnumType.HierarchicalCodelist)));
                    }
                }
            }
        }
コード例 #30
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////BUILD FROM V2 SCHEMA                 //////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Initializes a new instance of the <see cref="GroupCore"/> class.
        /// </summary>
        /// <param name="group">
        /// The group. 
        /// </param>
        /// <param name="parent">
        /// The parent. 
        /// </param>
        public GroupCore(Org.Sdmx.Resources.SdmxMl.Schemas.V20.structure.GroupType group, ISdmxStructure parent)
            : base(
                group, 
                SdmxStructureType.GetFromEnum(SdmxStructureEnumType.Group), 
                group.id, 
                null, 
                group.Annotations, 
                parent)
        {
            this.dimensionRef = new List<string>();

            /*
             * We do NOT support Attachment Constraint References in Version 2 since they are essentially useless.
             */
            if (group.DimensionRef != null)
            {
                this.dimensionRef = new List<string>(group.DimensionRef);
            }

            this.ValidateGroupAttributes();
        }