/// <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; }
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()); } }
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(); } }
/// <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(); }
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); } }
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); } }
/// <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()"); }
/// <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); } }
/// <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); } }
/// <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()); } }
internal ODataJsonCollectionDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { this.duplicatePropertyNamesChecker = base.CreateDuplicatePropertyNamesChecker(); }
/// <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(); } }
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 ODataJsonEntityReferenceLinkDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { DebugUtils.CheckNoExternalCallers(); }
/// <summary> /// Constructor. /// </summary> /// <param name="jsonInputContext">The JSON input context to read from.</param> internal ODataJsonPropertyAndValueDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { DebugUtils.CheckNoExternalCallers(); }
protected ODataJsonDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { this.jsonInputContext = jsonInputContext; }
/// <summary> /// Constructor. /// </summary> /// <param name="jsonInputContext">The JSON input context to read from.</param> internal ODataJsonEntryAndFeedDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { DebugUtils.CheckNoExternalCallers(); }
/// <summary> /// Constructor. /// </summary> /// <param name="jsonInputContext">The JSON input context to read from.</param> internal ODataJsonPayloadKindDetectionDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { DebugUtils.CheckNoExternalCallers(); }
internal ODataJsonParameterReader(ODataJsonInputContext jsonInputContext, IEdmFunctionImport functionImport) : base(jsonInputContext, functionImport) { this.jsonInputContext = jsonInputContext; this.jsonPropertyAndValueDeserializer = new ODataJsonPropertyAndValueDeserializer(jsonInputContext); }
/// <summary> /// Constructor. /// </summary> /// <param name="jsonInputContext">The JSON input context to read from.</param> internal ODataJsonErrorDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { DebugUtils.CheckNoExternalCallers(); }
internal ODataJsonEntryAndFeedDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { }
internal ODataJsonEntityReferenceLinkDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { }
internal ODataJsonPropertyAndValueDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { }
internal ODataJsonServiceDocumentDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { }
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; }
internal ODataJsonPayloadKindDetectionDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { this.detectedPayloadKinds = new HashSet <ODataPayloadKind>(EqualityComparer <ODataPayloadKind> .Default); }
internal ODataJsonErrorDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { }
/// <summary> /// Constructor. /// </summary> /// <param name="jsonInputContext">The JSON input context to read from.</param> internal ODataJsonServiceDocumentDeserializer(ODataJsonInputContext jsonInputContext) : base(jsonInputContext) { DebugUtils.CheckNoExternalCallers(); }