Пример #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The JSON input context to read from.</param>
        internal ODataVerboseJsonCollectionDeserializer(ODataVerboseJsonInputContext jsonInputContext)
            : base(jsonInputContext)
        {
            DebugUtils.CheckNoExternalCallers();

            this.duplicatePropertyNamesChecker = this.CreateDuplicatePropertyNamesChecker();
        }
Пример #2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The JSON input context to read from.</param>
        protected ODataVerboseJsonDeserializer(ODataVerboseJsonInputContext jsonInputContext)
            : base(jsonInputContext)
        {
            Debug.Assert(jsonInputContext != null, "jsonInputContext != null");

            this.jsonInputContext = jsonInputContext;
        }
Пример #3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="verboseJsonInputContext">The input to read the payload from.</param>
        /// <param name="functionImport">The function import whose parameters are being read.</param>
        internal ODataVerboseJsonParameterReader(ODataVerboseJsonInputContext verboseJsonInputContext, IEdmFunctionImport functionImport)
            : base(verboseJsonInputContext, functionImport)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(verboseJsonInputContext != null, "verboseJsonInputContext != null");
            Debug.Assert(verboseJsonInputContext.ReadingResponse == false, "verboseJsonInputContext.ReadingResponse == false");

            this.verboseJsonInputContext = verboseJsonInputContext;
            this.verboseJsonPropertyAndValueDeserializer = new ODataVerboseJsonPropertyAndValueDeserializer(verboseJsonInputContext);
            Debug.Assert(this.verboseJsonInputContext.Model.IsUserModel(), "this.verboseJsonInputContext.Model.IsUserModel()");
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="verboseJsonInputContext">The input to read the payload from.</param>
        /// <param name="expectedItemTypeReference">The expected type for the items in the collection.</param>
        /// <param name="listener">If not null, the reader will notify the implementer of the interface of relevant state changes in the reader.</param>
        internal ODataVerboseJsonCollectionReader(
            ODataVerboseJsonInputContext verboseJsonInputContext,
            IEdmTypeReference expectedItemTypeReference,
            IODataReaderWriterListener listener)
            : base(verboseJsonInputContext, expectedItemTypeReference, listener)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(verboseJsonInputContext != null, "verboseJsonInputContext != null");

            this.verboseJsonInputContext           = verboseJsonInputContext;
            this.verboseJsonCollectionDeserializer = new ODataVerboseJsonCollectionDeserializer(verboseJsonInputContext);

            if (!verboseJsonInputContext.Model.IsUserModel())
            {
                throw new ODataException(ODataErrorStrings.ODataJsonCollectionReader_ParsingWithoutMetadata);
            }
        }
Пример #5
0
 /// <summary>
 /// Detects the payload kind(s) from the message stream.
 /// </summary>
 /// <param name="messageStream">The message stream to read from for payload kind detection.</param>
 /// <param name="readingResponse">true if reading a response message; otherwise false.</param>
 /// <param name="synchronous">true if the input should be read synchronously; false if it should be read asynchronously.</param>
 /// <param name="detectionInfo">Additional information available for the payload kind detection.</param>
 /// <returns>An enumerable of zero, one or more payload kinds that were detected from looking at the payload in the message stream.</returns>
 private IEnumerable <ODataPayloadKind> DetectPayloadKindImplementation(
     Stream messageStream,
     bool readingResponse,
     bool synchronous,
     ODataPayloadKindDetectionInfo detectionInfo)
 {
     using (ODataVerboseJsonInputContext verboseJsonInputContext = new ODataVerboseJsonInputContext(
                this,
                messageStream,
                detectionInfo.GetEncoding(),
                detectionInfo.MessageReaderSettings,
                ODataVersion.V3, // NOTE: we don't rely on the version for payload kind detection; taking the latest.
                readingResponse,
                synchronous,
                detectionInfo.Model,
                /*urlResolver*/ null))
     {
         return(verboseJsonInputContext.DetectPayloadKind());
     }
 }
Пример #6
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="verboseJsonInputContext">The JSON input context to read from.</param>
 internal ODataVerboseJsonPropertyAndValueDeserializer(ODataVerboseJsonInputContext verboseJsonInputContext)
     : base(verboseJsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }
Пример #7
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="verboseJsonInputContext">The Verbose JSON input context to read from.</param>
 internal ODataVerboseJsonPayloadKindDetectionDeserializer(ODataVerboseJsonInputContext verboseJsonInputContext)
     : base(verboseJsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }
Пример #8
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="verboseJsonInputContext">The Verbose JSON input context to read from.</param>
 internal ODataVerboseJsonEntityReferenceLinkDeserializer(ODataVerboseJsonInputContext verboseJsonInputContext)
     : base(verboseJsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }
Пример #9
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="verboseJsonInputContext">The Verbose JSON input context to read from.</param>
 internal ODataVerboseJsonErrorDeserializer(ODataVerboseJsonInputContext verboseJsonInputContext)
     : base(verboseJsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="verboseJsonInputContext">The Verbose JSON input context to read from.</param>
 internal ODataVerboseJsonServiceDocumentDeserializer(ODataVerboseJsonInputContext verboseJsonInputContext)
     : base(verboseJsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }