Package com.mongodb.internal.connection
Class FieldTrackingBsonWriter
- java.lang.Object
 - 
- com.mongodb.internal.connection.BsonWriterDecorator
 - 
- com.mongodb.internal.connection.FieldTrackingBsonWriter
 
 
 
- 
- All Implemented Interfaces:
 BsonWriter
public class FieldTrackingBsonWriter extends BsonWriterDecorator
 
- 
- 
Constructor Summary
Constructors Constructor Description FieldTrackingBsonWriter(BsonWriter bsonWriter) 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanhasWrittenField()voidpipe(BsonReader reader)Reads a single document from a BsonReader and writes it to this.voidwriteBinaryData(java.lang.String name, BsonBinary binary)Writes a BSON Binary data element to the writer.voidwriteBinaryData(BsonBinary binary)Writes a BSON Binary data element to the writer.voidwriteBoolean(boolean value)Writes a BSON Boolean to the writer.voidwriteBoolean(java.lang.String name, boolean value)Writes a BSON Boolean element to the writer.voidwriteDateTime(long value)Writes a BSON DateTime to the writer.voidwriteDateTime(java.lang.String name, long value)Writes a BSON DateTime element to the writer.voidwriteDBPointer(java.lang.String name, BsonDbPointer value)Writes a BSON DBPointer element to the writer.voidwriteDBPointer(BsonDbPointer value)Writes a BSON DBPointer to the writer.voidwriteDecimal128(java.lang.String name, Decimal128 value)Writes a BSON Decimal128 element to the writer.voidwriteDecimal128(Decimal128 value)Writes a BSON Decimal128 to the writer.voidwriteDouble(double value)Writes a BSON Double to the writer.voidwriteDouble(java.lang.String name, double value)Writes a BSON Double element to the writer.voidwriteInt32(int value)Writes a BSON Int32 to the writer.voidwriteInt32(java.lang.String name, int value)Writes a BSON Int32 element to the writer.voidwriteInt64(long value)Writes a BSON Int64 to the writer.voidwriteInt64(java.lang.String name, long value)Writes a BSON Int64 element to the writer.voidwriteJavaScript(java.lang.String code)Writes a BSON JavaScript to the writer.voidwriteJavaScript(java.lang.String name, java.lang.String code)Writes a BSON JavaScript element to the writer.voidwriteJavaScriptWithScope(java.lang.String code)Writes a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope).voidwriteJavaScriptWithScope(java.lang.String name, java.lang.String code)Writes a BSON JavaScript element to the writer (call WriteStartDocument to start writing the scope).voidwriteMaxKey()Writes a BSON MaxKey to the writer.voidwriteMaxKey(java.lang.String name)Writes a BSON MaxKey element to the writer.voidwriteMinKey()Writes a BSON MinKey to the writer.voidwriteMinKey(java.lang.String name)Writes a BSON MinKey element to the writer.voidwriteNull()Writes a BSON null to the writer.voidwriteNull(java.lang.String name)Writes a BSON null element to the writer.voidwriteObjectId(java.lang.String name, ObjectId objectId)Writes a BSON ObjectId element to the writer.voidwriteObjectId(ObjectId objectId)Writes a BSON ObjectId to the writer.voidwriteRegularExpression(java.lang.String name, BsonRegularExpression regularExpression)Writes a BSON regular expression element to the writer.voidwriteRegularExpression(BsonRegularExpression regularExpression)Writes a BSON regular expression to the writer.voidwriteStartArray()Writes the start of a BSON array to the writer.voidwriteStartArray(java.lang.String name)Writes the start of a BSON array element to the writer.voidwriteStartDocument()Writes the start of a BSON document to the writer.voidwriteStartDocument(java.lang.String name)Writes the start of a BSON document element to the writer.voidwriteString(java.lang.String value)Writes a BSON String to the writer.voidwriteString(java.lang.String name, java.lang.String value)Writes a BSON String element to the writer.voidwriteSymbol(java.lang.String value)Writes a BSON Symbol to the writer.voidwriteSymbol(java.lang.String name, java.lang.String value)Writes a BSON Symbol element to the writer.voidwriteTimestamp(java.lang.String name, BsonTimestamp value)Writes a BSON Timestamp element to the writer.voidwriteTimestamp(BsonTimestamp value)Writes a BSON Timestamp to the writer.voidwriteUndefined()Writes a BSON undefined to the writer.voidwriteUndefined(java.lang.String name)Writes a BSON undefined element to the writer.- 
Methods inherited from class com.mongodb.internal.connection.BsonWriterDecorator
flush, writeEndArray, writeEndDocument, writeName 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
FieldTrackingBsonWriter
public FieldTrackingBsonWriter(BsonWriter bsonWriter)
 
 - 
 
- 
Method Detail
- 
hasWrittenField
public boolean hasWrittenField()
 
- 
writeStartDocument
public void writeStartDocument(java.lang.String name)
Description copied from interface:BsonWriterWrites the start of a BSON document element to the writer.- Specified by:
 writeStartDocumentin interfaceBsonWriter- Overrides:
 writeStartDocumentin classBsonWriterDecorator- Parameters:
 name- The name of the element.
 
- 
writeStartDocument
public void writeStartDocument()
Description copied from interface:BsonWriterWrites the start of a BSON document to the writer.- Specified by:
 writeStartDocumentin interfaceBsonWriter- Overrides:
 writeStartDocumentin classBsonWriterDecorator
 
- 
writeStartArray
public void writeStartArray(java.lang.String name)
Description copied from interface:BsonWriterWrites the start of a BSON array element to the writer.- Specified by:
 writeStartArrayin interfaceBsonWriter- Overrides:
 writeStartArrayin classBsonWriterDecorator- Parameters:
 name- The name of the element.
 
- 
writeStartArray
public void writeStartArray()
Description copied from interface:BsonWriterWrites the start of a BSON array to the writer.- Specified by:
 writeStartArrayin interfaceBsonWriter- Overrides:
 writeStartArrayin classBsonWriterDecorator
 
- 
writeBinaryData
public void writeBinaryData(java.lang.String name, BsonBinary binary)Description copied from interface:BsonWriterWrites a BSON Binary data element to the writer.- Specified by:
 writeBinaryDatain interfaceBsonWriter- Overrides:
 writeBinaryDatain classBsonWriterDecorator- Parameters:
 name- The name of the element.binary- The Binary data value.
 
- 
writeBinaryData
public void writeBinaryData(BsonBinary binary)
Description copied from interface:BsonWriterWrites a BSON Binary data element to the writer.- Specified by:
 writeBinaryDatain interfaceBsonWriter- Overrides:
 writeBinaryDatain classBsonWriterDecorator- Parameters:
 binary- The Binary data.
 
- 
writeBoolean
public void writeBoolean(java.lang.String name, boolean value)Description copied from interface:BsonWriterWrites a BSON Boolean element to the writer.- Specified by:
 writeBooleanin interfaceBsonWriter- Overrides:
 writeBooleanin classBsonWriterDecorator- Parameters:
 name- The name of the element.value- The Boolean value.
 
- 
writeBoolean
public void writeBoolean(boolean value)
Description copied from interface:BsonWriterWrites a BSON Boolean to the writer.- Specified by:
 writeBooleanin interfaceBsonWriter- Overrides:
 writeBooleanin classBsonWriterDecorator- Parameters:
 value- The Boolean value.
 
- 
writeDateTime
public void writeDateTime(java.lang.String name, long value)Description copied from interface:BsonWriterWrites a BSON DateTime element to the writer.- Specified by:
 writeDateTimein interfaceBsonWriter- Overrides:
 writeDateTimein classBsonWriterDecorator- Parameters:
 name- The name of the element.value- The number of milliseconds since the Unix epoch.
 
- 
writeDateTime
public void writeDateTime(long value)
Description copied from interface:BsonWriterWrites a BSON DateTime to the writer.- Specified by:
 writeDateTimein interfaceBsonWriter- Overrides:
 writeDateTimein classBsonWriterDecorator- Parameters:
 value- The number of milliseconds since the Unix epoch.
 
- 
writeDBPointer
public void writeDBPointer(java.lang.String name, BsonDbPointer value)Description copied from interface:BsonWriterWrites a BSON DBPointer element to the writer.- Specified by:
 writeDBPointerin interfaceBsonWriter- Overrides:
 writeDBPointerin classBsonWriterDecorator- Parameters:
 name- The name of the element.value- The DBPointer to write
 
- 
writeDBPointer
public void writeDBPointer(BsonDbPointer value)
Description copied from interface:BsonWriterWrites a BSON DBPointer to the writer.- Specified by:
 writeDBPointerin interfaceBsonWriter- Overrides:
 writeDBPointerin classBsonWriterDecorator- Parameters:
 value- The DBPointer to write
 
- 
writeDouble
public void writeDouble(java.lang.String name, double value)Description copied from interface:BsonWriterWrites a BSON Double element to the writer.- Specified by:
 writeDoublein interfaceBsonWriter- Overrides:
 writeDoublein classBsonWriterDecorator- Parameters:
 name- The name of the element.value- The Double value.
 
- 
writeDouble
public void writeDouble(double value)
Description copied from interface:BsonWriterWrites a BSON Double to the writer.- Specified by:
 writeDoublein interfaceBsonWriter- Overrides:
 writeDoublein classBsonWriterDecorator- Parameters:
 value- The Double value.
 
- 
writeInt32
public void writeInt32(java.lang.String name, int value)Description copied from interface:BsonWriterWrites a BSON Int32 element to the writer.- Specified by:
 writeInt32in interfaceBsonWriter- Overrides:
 writeInt32in classBsonWriterDecorator- Parameters:
 name- The name of the element.value- The Int32 value.
 
- 
writeInt32
public void writeInt32(int value)
Description copied from interface:BsonWriterWrites a BSON Int32 to the writer.- Specified by:
 writeInt32in interfaceBsonWriter- Overrides:
 writeInt32in classBsonWriterDecorator- Parameters:
 value- The Int32 value.
 
- 
writeInt64
public void writeInt64(java.lang.String name, long value)Description copied from interface:BsonWriterWrites a BSON Int64 element to the writer.- Specified by:
 writeInt64in interfaceBsonWriter- Overrides:
 writeInt64in classBsonWriterDecorator- Parameters:
 name- The name of the element.value- The Int64 value.
 
- 
writeInt64
public void writeInt64(long value)
Description copied from interface:BsonWriterWrites a BSON Int64 to the writer.- Specified by:
 writeInt64in interfaceBsonWriter- Overrides:
 writeInt64in classBsonWriterDecorator- Parameters:
 value- The Int64 value.
 
- 
writeDecimal128
public void writeDecimal128(Decimal128 value)
Description copied from interface:BsonWriterWrites a BSON Decimal128 to the writer.- Specified by:
 writeDecimal128in interfaceBsonWriter- Overrides:
 writeDecimal128in classBsonWriterDecorator- Parameters:
 value- The Decimal128 value.
 
- 
writeDecimal128
public void writeDecimal128(java.lang.String name, Decimal128 value)Description copied from interface:BsonWriterWrites a BSON Decimal128 element to the writer.- Specified by:
 writeDecimal128in interfaceBsonWriter- Overrides:
 writeDecimal128in classBsonWriterDecorator- Parameters:
 name- The name of the element.value- The Decimal128 value.
 
- 
writeJavaScript
public void writeJavaScript(java.lang.String name, java.lang.String code)Description copied from interface:BsonWriterWrites a BSON JavaScript element to the writer.- Specified by:
 writeJavaScriptin interfaceBsonWriter- Overrides:
 writeJavaScriptin classBsonWriterDecorator- Parameters:
 name- The name of the element.code- The JavaScript code.
 
- 
writeJavaScript
public void writeJavaScript(java.lang.String code)
Description copied from interface:BsonWriterWrites a BSON JavaScript to the writer.- Specified by:
 writeJavaScriptin interfaceBsonWriter- Overrides:
 writeJavaScriptin classBsonWriterDecorator- Parameters:
 code- The JavaScript code.
 
- 
writeJavaScriptWithScope
public void writeJavaScriptWithScope(java.lang.String name, java.lang.String code)Description copied from interface:BsonWriterWrites a BSON JavaScript element to the writer (call WriteStartDocument to start writing the scope).- Specified by:
 writeJavaScriptWithScopein interfaceBsonWriter- Overrides:
 writeJavaScriptWithScopein classBsonWriterDecorator- Parameters:
 name- The name of the element.code- The JavaScript code.
 
- 
writeJavaScriptWithScope
public void writeJavaScriptWithScope(java.lang.String code)
Description copied from interface:BsonWriterWrites a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope).- Specified by:
 writeJavaScriptWithScopein interfaceBsonWriter- Overrides:
 writeJavaScriptWithScopein classBsonWriterDecorator- Parameters:
 code- The JavaScript code.
 
- 
writeMaxKey
public void writeMaxKey(java.lang.String name)
Description copied from interface:BsonWriterWrites a BSON MaxKey element to the writer.- Specified by:
 writeMaxKeyin interfaceBsonWriter- Overrides:
 writeMaxKeyin classBsonWriterDecorator- Parameters:
 name- The name of the element.
 
- 
writeMaxKey
public void writeMaxKey()
Description copied from interface:BsonWriterWrites a BSON MaxKey to the writer.- Specified by:
 writeMaxKeyin interfaceBsonWriter- Overrides:
 writeMaxKeyin classBsonWriterDecorator
 
- 
writeMinKey
public void writeMinKey(java.lang.String name)
Description copied from interface:BsonWriterWrites a BSON MinKey element to the writer.- Specified by:
 writeMinKeyin interfaceBsonWriter- Overrides:
 writeMinKeyin classBsonWriterDecorator- Parameters:
 name- The name of the element.
 
- 
writeMinKey
public void writeMinKey()
Description copied from interface:BsonWriterWrites a BSON MinKey to the writer.- Specified by:
 writeMinKeyin interfaceBsonWriter- Overrides:
 writeMinKeyin classBsonWriterDecorator
 
- 
writeNull
public void writeNull(java.lang.String name)
Description copied from interface:BsonWriterWrites a BSON null element to the writer.- Specified by:
 writeNullin interfaceBsonWriter- Overrides:
 writeNullin classBsonWriterDecorator- Parameters:
 name- The name of the element.
 
- 
writeNull
public void writeNull()
Description copied from interface:BsonWriterWrites a BSON null to the writer.- Specified by:
 writeNullin interfaceBsonWriter- Overrides:
 writeNullin classBsonWriterDecorator
 
- 
writeObjectId
public void writeObjectId(java.lang.String name, ObjectId objectId)Description copied from interface:BsonWriterWrites a BSON ObjectId element to the writer.- Specified by:
 writeObjectIdin interfaceBsonWriter- Overrides:
 writeObjectIdin classBsonWriterDecorator- Parameters:
 name- The name of the element.objectId- The ObjectId value.
 
- 
writeObjectId
public void writeObjectId(ObjectId objectId)
Description copied from interface:BsonWriterWrites a BSON ObjectId to the writer.- Specified by:
 writeObjectIdin interfaceBsonWriter- Overrides:
 writeObjectIdin classBsonWriterDecorator- Parameters:
 objectId- The ObjectId value.
 
- 
writeRegularExpression
public void writeRegularExpression(java.lang.String name, BsonRegularExpression regularExpression)Description copied from interface:BsonWriterWrites a BSON regular expression element to the writer.- Specified by:
 writeRegularExpressionin interfaceBsonWriter- Overrides:
 writeRegularExpressionin classBsonWriterDecorator- Parameters:
 name- The name of the element.regularExpression- The RegularExpression value.
 
- 
writeRegularExpression
public void writeRegularExpression(BsonRegularExpression regularExpression)
Description copied from interface:BsonWriterWrites a BSON regular expression to the writer.- Specified by:
 writeRegularExpressionin interfaceBsonWriter- Overrides:
 writeRegularExpressionin classBsonWriterDecorator- Parameters:
 regularExpression- the regular expression to write.
 
- 
writeString
public void writeString(java.lang.String name, java.lang.String value)Description copied from interface:BsonWriterWrites a BSON String element to the writer.- Specified by:
 writeStringin interfaceBsonWriter- Overrides:
 writeStringin classBsonWriterDecorator- Parameters:
 name- The name of the element.value- The String value.
 
- 
writeString
public void writeString(java.lang.String value)
Description copied from interface:BsonWriterWrites a BSON String to the writer.- Specified by:
 writeStringin interfaceBsonWriter- Overrides:
 writeStringin classBsonWriterDecorator- Parameters:
 value- The String value.
 
- 
writeSymbol
public void writeSymbol(java.lang.String name, java.lang.String value)Description copied from interface:BsonWriterWrites a BSON Symbol element to the writer.- Specified by:
 writeSymbolin interfaceBsonWriter- Overrides:
 writeSymbolin classBsonWriterDecorator- Parameters:
 name- The name of the element.value- The symbol.
 
- 
writeSymbol
public void writeSymbol(java.lang.String value)
Description copied from interface:BsonWriterWrites a BSON Symbol to the writer.- Specified by:
 writeSymbolin interfaceBsonWriter- Overrides:
 writeSymbolin classBsonWriterDecorator- Parameters:
 value- The symbol.
 
- 
writeTimestamp
public void writeTimestamp(java.lang.String name, BsonTimestamp value)Description copied from interface:BsonWriterWrites a BSON Timestamp element to the writer.- Specified by:
 writeTimestampin interfaceBsonWriter- Overrides:
 writeTimestampin classBsonWriterDecorator- Parameters:
 name- The name of the element.value- The combined timestamp/increment value.
 
- 
writeTimestamp
public void writeTimestamp(BsonTimestamp value)
Description copied from interface:BsonWriterWrites a BSON Timestamp to the writer.- Specified by:
 writeTimestampin interfaceBsonWriter- Overrides:
 writeTimestampin classBsonWriterDecorator- Parameters:
 value- The combined timestamp/increment value.
 
- 
writeUndefined
public void writeUndefined(java.lang.String name)
Description copied from interface:BsonWriterWrites a BSON undefined element to the writer.- Specified by:
 writeUndefinedin interfaceBsonWriter- Overrides:
 writeUndefinedin classBsonWriterDecorator- Parameters:
 name- The name of the element.
 
- 
writeUndefined
public void writeUndefined()
Description copied from interface:BsonWriterWrites a BSON undefined to the writer.- Specified by:
 writeUndefinedin interfaceBsonWriter- Overrides:
 writeUndefinedin classBsonWriterDecorator
 
- 
pipe
public void pipe(BsonReader reader)
Description copied from interface:BsonWriterReads a single document from a BsonReader and writes it to this.- Specified by:
 pipein interfaceBsonWriter- Overrides:
 pipein classBsonWriterDecorator- Parameters:
 reader- The source.
 
 - 
 
 -