JsonWriter Class (original) (raw)

Represents a BSON writer to a TextWriter (in JSON format).

Inheritance Hierarchy

SystemObject
MongoDB.Bson.IOBsonWriter
MongoDB.Bson.IOJsonWriter

Namespace: MongoDB.Bson.IO
Assembly: MongoDB.Bson (in MongoDB.Bson.dll) Version: 2.10.0+569905ff5e778c38ea19d9d0392496a83e1704ed

Syntax

C#

VB

F#

Copy

public class JsonWriter : BsonWriter

Public Class JsonWriter Inherits BsonWriter

type JsonWriter =
class inherit BsonWriter end

The JsonWriter type exposes the following members.

Constructors

| | Name | Description | | | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | --------------------------------------------------- | | Public method | JsonWriter(TextWriter) | Initializes a new instance of the JsonWriter class. | | Public method | JsonWriter(TextWriter, JsonWriterSettings) | Initializes a new instance of the JsonWriter class. |

Top

Properties

| | Name | Description | | | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Public property | BaseTextWriter | Gets the base TextWriter. | | Public property | Disposed | Gets whether the BsonWriter has been disposed. (Inherited from BsonWriter.) | | Protected property | Name | Gets the name of the element being written. (Inherited from BsonWriter.) | | Public property | Position | Gets the position. Not all writers are able to report the position. Those that can't simply return zero. (Overrides BsonWriterPosition.) | | Public property | SerializationDepth | Gets the current serialization depth. (Inherited from BsonWriter.) | | Public property | Settings | Gets the settings of the writer. | | Public property | State | Gets the current state of the writer. (Inherited from BsonWriter.) |

Top

Methods

| | Name | Description | | | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | Public method | Close | Closes the writer. (Overrides BsonWriterClose.) | | Public method | Dispose | Disposes of any resources used by the writer. (Inherited from BsonWriter.) | | Protected method | Dispose(Boolean) | Disposes of any resources used by the writer. (Overrides BsonWriterDispose(Boolean).) | | Public method | Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | | Protected method | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | | Public method | Flush | Flushes any pending data to the output destination. (Overrides BsonWriterFlush.) | | Public method | GetHashCode | Serves as the default hash function. (Inherited from Object.) | | Public method | GetType | Gets the Type of the current instance. (Inherited from Object.) | | Protected method | MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | | Public method | PopElementNameValidator | Pops the element name validator. (Inherited from BsonWriter.) | | Public method | PopSettings | Pops the settings. (Inherited from BsonWriter.) | | Public method | PushElementNameValidator | Pushes the element name validator. (Inherited from BsonWriter.) | | Public method | PushSettings | Pushes new settings for the writer. (Inherited from BsonWriter.) | | Protected method | ThrowInvalidContextType | Throws an InvalidOperationException when the method called is not valid for the current ContextType. (Inherited from BsonWriter.) | | Protected method | ThrowInvalidState | Throws an InvalidOperationException when the method called is not valid for the current state. (Inherited from BsonWriter.) | | Public method | ToString | Returns a string that represents the current object. (Inherited from Object.) | | Public method | WriteBinaryData | Writes BSON binary data to the writer. (Overrides BsonWriterWriteBinaryData(BsonBinaryData).) | | Public method | WriteBoolean | Writes a BSON Boolean to the writer. (Overrides BsonWriterWriteBoolean(Boolean).) | | Public method | WriteBytes | Writes BSON binary data to the writer. (Overrides BsonWriterWriteBytes(Byte).) | | Public method | WriteDateTime | Writes a BSON DateTime to the writer. (Overrides BsonWriterWriteDateTime(Int64).) | | Public method | WriteDecimal128 | Writes a BSON Decimal128 to the writer. (Overrides BsonWriterWriteDecimal128(Decimal128).) | | Public method | WriteDouble | Writes a BSON Double to the writer. (Overrides BsonWriterWriteDouble(Double).) | | Public method | WriteEndArray | Writes the end of a BSON array to the writer. (Overrides BsonWriterWriteEndArray.) | | Public method | WriteEndDocument | Writes the end of a BSON document to the writer. (Overrides BsonWriterWriteEndDocument.) | | Public method | WriteInt32 | Writes a BSON Int32 to the writer. (Overrides BsonWriterWriteInt32(Int32).) | | Public method | WriteInt64 | Writes a BSON Int64 to the writer. (Overrides BsonWriterWriteInt64(Int64).) | | Public method | WriteJavaScript | Writes a BSON JavaScript to the writer. (Overrides BsonWriterWriteJavaScript(String).) | | Public method | WriteJavaScriptWithScope | Writes a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope). (Overrides BsonWriterWriteJavaScriptWithScope(String).) | | Public method | WriteMaxKey | Writes a BSON MaxKey to the writer. (Overrides BsonWriterWriteMaxKey.) | | Public method | WriteMinKey | Writes a BSON MinKey to the writer. (Overrides BsonWriterWriteMinKey.) | | Public method | WriteName | Writes the name of an element to the writer. (Inherited from BsonWriter.) | | Public method | WriteNull | Writes a BSON null to the writer. (Overrides BsonWriterWriteNull.) | | Public method | WriteObjectId | Writes a BSON ObjectId to the writer. (Overrides BsonWriterWriteObjectId(ObjectId).) | | Public method | WriteRawBsonArray | Writes a raw BSON array. (Inherited from BsonWriter.) | | Public method | WriteRawBsonDocument | Writes a raw BSON document. (Inherited from BsonWriter.) | | Public method | WriteRegularExpression | Writes a BSON regular expression to the writer. (Overrides BsonWriterWriteRegularExpression(BsonRegularExpression).) | | Public method | WriteStartArray | Writes the start of a BSON array to the writer. (Overrides BsonWriterWriteStartArray.) | | Public method | WriteStartDocument | Writes the start of a BSON document to the writer. (Overrides BsonWriterWriteStartDocument.) | | Public method | WriteString | Writes a BSON String to the writer. (Overrides BsonWriterWriteString(String).) | | Public method | WriteSymbol | Writes a BSON Symbol to the writer. (Overrides BsonWriterWriteSymbol(String).) | | Public method | WriteTimestamp | Writes a BSON timestamp to the writer. (Overrides BsonWriterWriteTimestamp(Int64).) | | Public method | WriteUndefined | Writes a BSON undefined to the writer. (Overrides BsonWriterWriteUndefined.) |

Top

Extension Methods

| | Name | Description | | | --------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | | Public Extension Method | ToBson | Serializes an object to a BSON byte array. (Defined by BsonExtensionMethods.) | | Public Extension Method | ToBsonDocument | Serializes an object to a BsonDocument. (Defined by BsonExtensionMethods.) | | Public Extension Method | ToJson | Serializes an object to a JSON string. (Defined by BsonExtensionMethods.) |

Top

See Also

Reference

MongoDB.Bson.IO Namespace