コード例 #1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The JSON input context to read from.</param>
        protected ODataJsonDeserializer(ODataJsonInputContext jsonInputContext)
            : base(jsonInputContext)
        {
            Debug.Assert(jsonInputContext != null, "jsonInputContext != null");

            this.jsonInputContext = jsonInputContext;
        }
コード例 #2
0
 private IEnumerable <ODataPayloadKind> DetectPayloadKindImplementation(Stream messageStream, bool readingResponse, bool synchronous, ODataPayloadKindDetectionInfo detectionInfo)
 {
     using (ODataJsonInputContext context = new ODataJsonInputContext(this, messageStream, detectionInfo.GetEncoding(), detectionInfo.MessageReaderSettings, ODataVersion.V3, readingResponse, synchronous, detectionInfo.Model, null))
     {
         return(context.DetectPayloadKind());
     }
 }
コード例 #3
0
 private IEnumerable<ODataPayloadKind> DetectPayloadKindImplementation(Stream messageStream, bool readingResponse, bool synchronous, ODataPayloadKindDetectionInfo detectionInfo)
 {
     using (ODataJsonInputContext context = new ODataJsonInputContext(this, messageStream, detectionInfo.GetEncoding(), detectionInfo.MessageReaderSettings, ODataVersion.V3, readingResponse, synchronous, detectionInfo.Model, null))
     {
         return context.DetectPayloadKind();
     }
 }
コード例 #4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The JSON input context to read from.</param>
        internal ODataJsonCollectionDeserializer(ODataJsonInputContext jsonInputContext)
            : base(jsonInputContext)
        {
            DebugUtils.CheckNoExternalCallers();

            this.duplicatePropertyNamesChecker = this.CreateDuplicatePropertyNamesChecker();
        }
コード例 #5
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The JSON input context to read from.</param>
        internal ODataJsonCollectionDeserializer(ODataJsonInputContext jsonInputContext)
            : base(jsonInputContext)
        {
            DebugUtils.CheckNoExternalCallers();

            this.duplicatePropertyNamesChecker = this.CreateDuplicatePropertyNamesChecker();
        }
コード例 #6
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The JSON input context to read from.</param>
        protected ODataJsonDeserializer(ODataJsonInputContext jsonInputContext)
            : base(jsonInputContext)
        {
            Debug.Assert(jsonInputContext != null, "jsonInputContext != null");

            this.jsonInputContext = jsonInputContext;
        }
コード例 #7
0
 internal ODataJsonCollectionReader(ODataJsonInputContext jsonInputContext, IEdmTypeReference expectedItemTypeReference, IODataReaderWriterListener listener) : base(jsonInputContext, expectedItemTypeReference, listener)
 {
     this.jsonInputContext           = jsonInputContext;
     this.jsonCollectionDeserializer = new ODataJsonCollectionDeserializer(jsonInputContext);
     if (!jsonInputContext.Model.IsUserModel())
     {
         throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonCollectionReader_ParsingWithoutMetadata);
     }
 }
コード例 #8
0
ファイル: ODataJsonReader.cs プロジェクト: modulexcite/pash-1
 internal ODataJsonReader(ODataJsonInputContext jsonInputContext, IEdmEntityType expectedEntityType, bool readingFeed, IODataReaderWriterListener listener) : base(jsonInputContext, expectedEntityType, readingFeed, listener)
 {
     this.jsonInputContext             = jsonInputContext;
     this.jsonEntryAndFeedDeserializer = new ODataJsonEntryAndFeedDeserializer(jsonInputContext);
     if (!this.jsonInputContext.Model.IsUserModel())
     {
         throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonReader_ParsingWithoutMetadata);
     }
 }
コード例 #9
0
ファイル: ODataJsonReader.cs プロジェクト: nickchal/pash
 internal ODataJsonReader(ODataJsonInputContext jsonInputContext, IEdmEntityType expectedEntityType, bool readingFeed, IODataReaderWriterListener listener) : base(jsonInputContext, expectedEntityType, readingFeed, listener)
 {
     this.jsonInputContext = jsonInputContext;
     this.jsonEntryAndFeedDeserializer = new ODataJsonEntryAndFeedDeserializer(jsonInputContext);
     if (!this.jsonInputContext.Model.IsUserModel())
     {
         throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonReader_ParsingWithoutMetadata);
     }
 }
コード例 #10
0
 internal ODataJsonCollectionReader(ODataJsonInputContext jsonInputContext, IEdmTypeReference expectedItemTypeReference, IODataReaderWriterListener listener) : base(jsonInputContext, expectedItemTypeReference, listener)
 {
     this.jsonInputContext = jsonInputContext;
     this.jsonCollectionDeserializer = new ODataJsonCollectionDeserializer(jsonInputContext);
     if (!jsonInputContext.Model.IsUserModel())
     {
         throw new ODataException(Microsoft.Data.OData.Strings.ODataJsonCollectionReader_ParsingWithoutMetadata);
     }
 }
コード例 #11
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The input to read the payload from.</param>
        /// <param name="functionImport">The function import whose parameters are being read.</param>
        internal ODataJsonParameterReader(ODataJsonInputContext jsonInputContext, IEdmFunctionImport functionImport)
            : base(jsonInputContext, functionImport)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(jsonInputContext != null, "jsonInputContext != null");
            Debug.Assert(jsonInputContext.ReadingResponse == false, "jsonInputContext.ReadingResponse == false");

            this.jsonInputContext = jsonInputContext;
            this.jsonPropertyAndValueDeserializer = new ODataJsonPropertyAndValueDeserializer(jsonInputContext);
            Debug.Assert(this.jsonInputContext.Model.IsUserModel(), "this.jsonInputContext.Model.IsUserModel()");
        }
コード例 #12
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The input to read the payload from.</param>
        /// <param name="functionImport">The function import whose parameters are being read.</param>
        internal ODataJsonParameterReader(ODataJsonInputContext jsonInputContext, IEdmFunctionImport functionImport)
            : base(jsonInputContext, functionImport)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(jsonInputContext != null, "jsonInputContext != null");
            Debug.Assert(jsonInputContext.ReadingResponse == false, "jsonInputContext.ReadingResponse == false");

            this.jsonInputContext = jsonInputContext;
            this.jsonPropertyAndValueDeserializer = new ODataJsonPropertyAndValueDeserializer(jsonInputContext);
            Debug.Assert(this.jsonInputContext.Model.IsUserModel(), "this.jsonInputContext.Model.IsUserModel()");
        }
コード例 #13
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">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 ODataJsonCollectionReader(ODataJsonInputContext jsonInputContext, IEdmTypeReference expectedItemTypeReference, IODataReaderWriterListener listener)
            : base(jsonInputContext, expectedItemTypeReference, listener)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(jsonInputContext != null, "jsonInputContext != null");

            this.jsonInputContext           = jsonInputContext;
            this.jsonCollectionDeserializer = new ODataJsonCollectionDeserializer(jsonInputContext);

            if (!jsonInputContext.Model.IsUserModel())
            {
                throw new ODataException(o.Strings.ODataJsonCollectionReader_ParsingWithoutMetadata);
            }
        }
コード例 #14
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonInputContext">The input to read the payload from.</param>
        /// <param name="expectedEntityType">The expected entity type for the entry to be read (in case of entry reader) or entries in the feed to be read (in case of feed reader).</param>
        /// <param name="readingFeed">true if the reader is created for reading a feed; false when it is created for reading an entry.</param>
        /// <param name="listener">If not null, the Json reader will notify the implementer of the interface of relevant state changes in the Json reader.</param>
        internal ODataJsonReader(ODataJsonInputContext jsonInputContext, IEdmEntityType expectedEntityType, bool readingFeed, IODataReaderWriterListener listener)
            : base(jsonInputContext, expectedEntityType, readingFeed, listener)
        {
            DebugUtils.CheckNoExternalCallers();
            Debug.Assert(jsonInputContext != null, "jsonInputContext != null");

            this.jsonInputContext = jsonInputContext;
            this.jsonEntryAndFeedDeserializer = new ODataJsonEntryAndFeedDeserializer(jsonInputContext);

            if (!this.jsonInputContext.Model.IsUserModel())
            {
                throw new ODataException(o.Strings.ODataJsonReader_ParsingWithoutMetadata);
            }
        }
コード例 #15
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 (ODataJsonInputContext jsonInputContext = new ODataJsonInputContext(
                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(jsonInputContext.DetectPayloadKind());
     }
 }
コード例 #16
0
 internal ODataJsonCollectionDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
     this.duplicatePropertyNamesChecker = base.CreateDuplicatePropertyNamesChecker();
 }
コード例 #17
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 (ODataJsonInputContext jsonInputContext = new ODataJsonInputContext(
         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 jsonInputContext.DetectPayloadKind();
     }
 }
コード例 #18
0
 internal ODataJsonPayloadKindDetectionDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
     this.detectedPayloadKinds = new HashSet<ODataPayloadKind>(EqualityComparer<ODataPayloadKind>.Default);
 }
コード例 #19
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="jsonInputContext">The JSON input context to read from.</param>
 internal ODataJsonEntityReferenceLinkDeserializer(ODataJsonInputContext jsonInputContext)
     : base(jsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }
コード例 #20
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="jsonInputContext">The JSON input context to read from.</param>
 internal ODataJsonEntityReferenceLinkDeserializer(ODataJsonInputContext jsonInputContext)
     : base(jsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }
コード例 #21
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="jsonInputContext">The JSON input context to read from.</param>
 internal ODataJsonPropertyAndValueDeserializer(ODataJsonInputContext jsonInputContext)
     : base(jsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }
コード例 #22
0
 protected ODataJsonDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
     this.jsonInputContext = jsonInputContext;
 }
コード例 #23
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="jsonInputContext">The JSON input context to read from.</param>
 internal ODataJsonEntryAndFeedDeserializer(ODataJsonInputContext jsonInputContext)
     : base(jsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }
コード例 #24
0
 protected ODataJsonDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
     this.jsonInputContext = jsonInputContext;
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="jsonInputContext">The JSON input context to read from.</param>
 internal ODataJsonPayloadKindDetectionDeserializer(ODataJsonInputContext jsonInputContext)
     : base(jsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }
コード例 #26
0
 internal ODataJsonParameterReader(ODataJsonInputContext jsonInputContext, IEdmFunctionImport functionImport) : base(jsonInputContext, functionImport)
 {
     this.jsonInputContext = jsonInputContext;
     this.jsonPropertyAndValueDeserializer = new ODataJsonPropertyAndValueDeserializer(jsonInputContext);
 }
コード例 #27
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="jsonInputContext">The JSON input context to read from.</param>
 internal ODataJsonErrorDeserializer(ODataJsonInputContext jsonInputContext)
     : base(jsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }
コード例 #28
0
 internal ODataJsonEntryAndFeedDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
 }
コード例 #29
0
 internal ODataJsonCollectionDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
     this.duplicatePropertyNamesChecker = base.CreateDuplicatePropertyNamesChecker();
 }
コード例 #30
0
 internal ODataJsonEntityReferenceLinkDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
 }
コード例 #31
0
 internal ODataJsonPropertyAndValueDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
 }
コード例 #32
0
 internal ODataJsonServiceDocumentDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
 }
コード例 #33
0
 internal ODataJsonParameterReader(ODataJsonInputContext jsonInputContext, IEdmFunctionImport functionImport) : base(jsonInputContext, functionImport)
 {
     this.jsonInputContext = jsonInputContext;
     this.jsonPropertyAndValueDeserializer = new ODataJsonPropertyAndValueDeserializer(jsonInputContext);
 }
コード例 #34
0
 internal static object ConvertFromComplexOrCollectionValue(string value, ODataVersion version, IEdmModel model, IEdmTypeReference typeReference)
 {
     object obj3;
     ODataMessageReaderSettings messageReaderSettings = new ODataMessageReaderSettings();
     using (StringReader reader = new StringReader(value))
     {
         using (ODataJsonInputContext context = new ODataJsonInputContext(ODataFormat.VerboseJson, reader, messageReaderSettings, version, false, true, model, null))
         {
             ODataJsonPropertyAndValueDeserializer deserializer = new ODataJsonPropertyAndValueDeserializer(context);
             deserializer.ReadPayloadStart(false);
             object obj2 = deserializer.ReadNonEntityValue(typeReference, null, null, true);
             deserializer.ReadPayloadEnd(false);
             obj3 = obj2;
         }
     }
     return obj3;
 }
コード例 #35
0
 internal ODataJsonEntityReferenceLinkDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
 }
コード例 #36
0
 internal ODataJsonEntryAndFeedDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
 }
コード例 #37
0
 internal ODataJsonPayloadKindDetectionDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
     this.detectedPayloadKinds = new HashSet <ODataPayloadKind>(EqualityComparer <ODataPayloadKind> .Default);
 }
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="jsonInputContext">The JSON input context to read from.</param>
 internal ODataJsonPayloadKindDetectionDeserializer(ODataJsonInputContext jsonInputContext)
     : base(jsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }
コード例 #39
0
 internal ODataJsonErrorDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
 }
コード例 #40
0
 internal ODataJsonServiceDocumentDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
 }
コード例 #41
0
 internal ODataJsonErrorDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
 }
コード例 #42
0
 internal ODataJsonPropertyAndValueDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext)
 {
 }
コード例 #43
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="jsonInputContext">The JSON input context to read from.</param>
 internal ODataJsonServiceDocumentDeserializer(ODataJsonInputContext jsonInputContext)
     : base(jsonInputContext)
 {
     DebugUtils.CheckNoExternalCallers();
 }