Ejemplo n.º 1
0
 /// <summary>
 ///     Moves the read position back to the start of the Data Set (<see cref="IDataReaderEngine.KeyablePosition" /> moved
 ///     back to -1)
 /// </summary>
 public void Reset()
 {
     this._currentlyProcessingReaderIndex = -1;
     this._ediDataReader = null;
     this._currentObsPos = -1;
     this._keyablePosition = -1;
     this._currentKey = null;
     this._currentObs = null;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EdiDataReaderEngine"/> class. 
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 /// <param name="header">
 /// The header.
 /// </param>
 /// <param name="dataflow">
 /// The dataflow.
 /// </param>
 /// <param name="dataStructureObject">
 /// The data Structure Bean.
 /// </param>
 /// <param name="ediDataReader">
 /// The edi Data Reader.
 /// </param>
 public EdiDataReaderEngine(IHeader header, IDataflowObject dataflow, IDataStructureObject dataStructureObject, IEdiDataReader ediDataReader)
 {
     this._header = header;
     this._dataStructureObject = dataStructureObject;
     this._dataflowObject = dataflow;
     this._ediDataReaders.Add(ediDataReader);
 }
Ejemplo n.º 3
0
        /// <summary>
        ///     Gets a value indicating whether the there are any more datasets in the data source
        /// </summary>
        /// <returns>
        ///     The <see cref="bool" /> .
        /// </returns>
        public bool MoveNextDataset()
        {
            this._currentlyProcessingReaderIndex++;
            if (this._ediDataReaders.Count > this._currentlyProcessingReaderIndex)
            {
                this._ediDataReader = this._ediDataReaders[this._currentlyProcessingReaderIndex];
                this.Start();
                return true;
            }

            return false;
        }
Ejemplo n.º 4
0
        /// <summary>
        ///     Starts this instance.
        /// </summary>
        /// <exception cref="SdmxNoResultsException">
        ///     Can not read EDI Data File - Data Structure can not be found: +
        ///     maintainableRefObject
        /// </exception>
        private void Start()
        {
            this._ediDataReader = this._ediDataReaders[this._currentlyProcessingReaderIndex];
            this._ediDataReader.ResetReader();
            this._inFootNoteSection = false;
            this._missingValue = this._ediDataReader.MissingValue;
            IMaintainableRefObject maintainableRefObject = this._ediDataReader.DataSetHeaderObject.DataStructureReference.StructureReference.MaintainableReference;
            if (this._objectRetrievalManager != null)
            {
                this._dataStructureObject = this._objectRetrievalManager.GetMaintainableObject<IDataStructureObject>(maintainableRefObject);
            }

            if (this._dataStructureObject == null)
            {
                throw new SdmxNoResultsException("Can not read EDI Data File - Data Structure can not be found:" + maintainableRefObject);
            }

            // metadata specific convention ?
            if (this._dataStructureObject.GetAttribute(this._obsConf) == null)
            {
                if (this._dataStructureObject.GetAttribute("CONF_STATUS") != null)
                {
                    this._obsConf = "CONF_STATUS";
                }
            }

            this._datasetAttributes = this._ediDataReader.DatasetAttributes;
            this.ObtainDataStructureInformation();
        }