public class ElementExtendingBsonWriter extends Object implements BsonWriter
| Constructor and Description |
|---|
ElementExtendingBsonWriter(BsonWriter bsonWriter,
List<BsonElement> extraElements)
Construct an instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
Flushes any pending data to the output destination.
|
void |
pipe(BsonReader reader)
Reads a single document from a BsonReader and writes it to this.
|
void |
pipe(BsonReader reader,
List<BsonElement> extraElements)
Reads a single document from a BsonReader and writes it to this, appending the given extra elements to the end of
the document.
|
void |
writeBinaryData(BsonBinary binary)
Writes a BSON Binary data element to the writer.
|
void |
writeBinaryData(String name,
BsonBinary binary)
Writes a BSON Binary data element to the writer.
|
void |
writeBoolean(boolean value)
Writes a BSON Boolean to the writer.
|
void |
writeBoolean(String name,
boolean value)
Writes a BSON Boolean element to the writer.
|
void |
writeDateTime(long value)
Writes a BSON DateTime to the writer.
|
void |
writeDateTime(String name,
long value)
Writes a BSON DateTime element to the writer.
|
void |
writeDBPointer(BsonDbPointer value)
Writes a BSON DBPointer to the writer.
|
void |
writeDBPointer(String name,
BsonDbPointer value)
Writes a BSON DBPointer element to the writer.
|
void |
writeDecimal128(Decimal128 value)
Writes a BSON Decimal128 to the writer.
|
void |
writeDecimal128(String name,
Decimal128 value)
Writes a BSON Decimal128 element to the writer.
|
void |
writeDouble(double value)
Writes a BSON Double to the writer.
|
void |
writeDouble(String name,
double value)
Writes a BSON Double element to the writer.
|
void |
writeEndArray()
Writes the end of a BSON array to the writer.
|
void |
writeEndDocument()
Writes the end of a BSON document to the writer.
|
void |
writeInt32(int value)
Writes a BSON Int32 to the writer.
|
void |
writeInt32(String name,
int value)
Writes a BSON Int32 element to the writer.
|
void |
writeInt64(long value)
Writes a BSON Int64 to the writer.
|
void |
writeInt64(String name,
long value)
Writes a BSON Int64 element to the writer.
|
void |
writeJavaScript(String code)
Writes a BSON JavaScript to the writer.
|
void |
writeJavaScript(String name,
String code)
Writes a BSON JavaScript element to the writer.
|
void |
writeJavaScriptWithScope(String code)
Writes a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope).
|
void |
writeJavaScriptWithScope(String name,
String code)
Writes a BSON JavaScript element to the writer (call WriteStartDocument to start writing the scope).
|
void |
writeMaxKey()
Writes a BSON MaxKey to the writer.
|
void |
writeMaxKey(String name)
Writes a BSON MaxKey element to the writer.
|
void |
writeMinKey()
Writes a BSON MinKey to the writer.
|
void |
writeMinKey(String name)
Writes a BSON MinKey element to the writer.
|
void |
writeName(String name)
Writes the name of an element to the writer.
|
void |
writeNull()
Writes a BSON null to the writer.
|
void |
writeNull(String name)
Writes a BSON null element to the writer.
|
void |
writeObjectId(ObjectId objectId)
Writes a BSON ObjectId to the writer.
|
void |
writeObjectId(String name,
ObjectId objectId)
Writes a BSON ObjectId element to the writer.
|
void |
writeRegularExpression(BsonRegularExpression regularExpression)
Writes a BSON regular expression to the writer.
|
void |
writeRegularExpression(String name,
BsonRegularExpression regularExpression)
Writes a BSON regular expression element to the writer.
|
void |
writeStartArray()
Writes the start of a BSON array to the writer.
|
void |
writeStartArray(String name)
Writes the start of a BSON array element to the writer.
|
void |
writeStartDocument()
Writes the start of a BSON document to the writer.
|
void |
writeStartDocument(String name)
Writes the start of a BSON document element to the writer.
|
void |
writeString(String value)
Writes a BSON String to the writer.
|
void |
writeString(String name,
String value)
Writes a BSON String element to the writer.
|
void |
writeSymbol(String value)
Writes a BSON Symbol to the writer.
|
void |
writeSymbol(String name,
String value)
Writes a BSON Symbol element to the writer.
|
void |
writeTimestamp(BsonTimestamp value)
Writes a BSON Timestamp to the writer.
|
void |
writeTimestamp(String name,
BsonTimestamp value)
Writes a BSON Timestamp element to the writer.
|
void |
writeUndefined()
Writes a BSON undefined to the writer.
|
void |
writeUndefined(String name)
Writes a BSON undefined element to the writer.
|
public ElementExtendingBsonWriter(BsonWriter bsonWriter, List<BsonElement> extraElements)
bsonWriter - the delegateextraElements - the extra elementspublic void writeStartDocument(String name)
BsonWriterwriteStartDocument in interface BsonWritername - The name of the element.public void writeStartDocument()
BsonWriterwriteStartDocument in interface BsonWriterpublic void writeEndDocument()
BsonWriterwriteEndDocument in interface BsonWriterpublic void writeStartArray(String name)
BsonWriterwriteStartArray in interface BsonWritername - The name of the element.public void writeStartArray()
BsonWriterwriteStartArray in interface BsonWriterpublic void writeEndArray()
BsonWriterwriteEndArray in interface BsonWriterpublic void writeBinaryData(String name, BsonBinary binary)
BsonWriterwriteBinaryData in interface BsonWritername - The name of the element.binary - The Binary data value.public void writeBinaryData(BsonBinary binary)
BsonWriterwriteBinaryData in interface BsonWriterbinary - The Binary data.public void writeBoolean(String name, boolean value)
BsonWriterwriteBoolean in interface BsonWritername - The name of the element.value - The Boolean value.public void writeBoolean(boolean value)
BsonWriterwriteBoolean in interface BsonWritervalue - The Boolean value.public void writeDateTime(String name, long value)
BsonWriterwriteDateTime in interface BsonWritername - The name of the element.value - The number of milliseconds since the Unix epoch.public void writeDateTime(long value)
BsonWriterwriteDateTime in interface BsonWritervalue - The number of milliseconds since the Unix epoch.public void writeDBPointer(String name, BsonDbPointer value)
BsonWriterwriteDBPointer in interface BsonWritername - The name of the element.value - The DBPointer to writepublic void writeDBPointer(BsonDbPointer value)
BsonWriterwriteDBPointer in interface BsonWritervalue - The DBPointer to writepublic void writeDouble(String name, double value)
BsonWriterwriteDouble in interface BsonWritername - The name of the element.value - The Double value.public void writeDouble(double value)
BsonWriterwriteDouble in interface BsonWritervalue - The Double value.public void writeInt32(String name, int value)
BsonWriterwriteInt32 in interface BsonWritername - The name of the element.value - The Int32 value.public void writeInt32(int value)
BsonWriterwriteInt32 in interface BsonWritervalue - The Int32 value.public void writeInt64(String name, long value)
BsonWriterwriteInt64 in interface BsonWritername - The name of the element.value - The Int64 value.public void writeInt64(long value)
BsonWriterwriteInt64 in interface BsonWritervalue - The Int64 value.public void writeDecimal128(Decimal128 value)
BsonWriterwriteDecimal128 in interface BsonWritervalue - The Decimal128 value.public void writeDecimal128(String name, Decimal128 value)
BsonWriterwriteDecimal128 in interface BsonWritername - The name of the element.value - The Decimal128 value.public void writeJavaScript(String name, String code)
BsonWriterwriteJavaScript in interface BsonWritername - The name of the element.code - The JavaScript code.public void writeJavaScript(String code)
BsonWriterwriteJavaScript in interface BsonWritercode - The JavaScript code.public void writeJavaScriptWithScope(String name, String code)
BsonWriterwriteJavaScriptWithScope in interface BsonWritername - The name of the element.code - The JavaScript code.public void writeJavaScriptWithScope(String code)
BsonWriterwriteJavaScriptWithScope in interface BsonWritercode - The JavaScript code.public void writeMaxKey(String name)
BsonWriterwriteMaxKey in interface BsonWritername - The name of the element.public void writeMaxKey()
BsonWriterwriteMaxKey in interface BsonWriterpublic void writeMinKey(String name)
BsonWriterwriteMinKey in interface BsonWritername - The name of the element.public void writeMinKey()
BsonWriterwriteMinKey in interface BsonWriterpublic void writeName(String name)
BsonWriterwriteName in interface BsonWritername - The name of the element.public void writeNull(String name)
BsonWriterwriteNull in interface BsonWritername - The name of the element.public void writeNull()
BsonWriterwriteNull in interface BsonWriterpublic void writeObjectId(String name, ObjectId objectId)
BsonWriterwriteObjectId in interface BsonWritername - The name of the element.objectId - The ObjectId value.public void writeObjectId(ObjectId objectId)
BsonWriterwriteObjectId in interface BsonWriterobjectId - The ObjectId value.public void writeRegularExpression(String name, BsonRegularExpression regularExpression)
BsonWriterwriteRegularExpression in interface BsonWritername - The name of the element.regularExpression - The RegularExpression value.public void writeRegularExpression(BsonRegularExpression regularExpression)
BsonWriterwriteRegularExpression in interface BsonWriterregularExpression - the regular expression to write.public void writeString(String name, String value)
BsonWriterwriteString in interface BsonWritername - The name of the element.value - The String value.public void writeString(String value)
BsonWriterwriteString in interface BsonWritervalue - The String value.public void writeSymbol(String name, String value)
BsonWriterwriteSymbol in interface BsonWritername - The name of the element.value - The symbol.public void writeSymbol(String value)
BsonWriterwriteSymbol in interface BsonWritervalue - The symbol.public void writeTimestamp(String name, BsonTimestamp value)
BsonWriterwriteTimestamp in interface BsonWritername - The name of the element.value - The combined timestamp/increment value.public void writeTimestamp(BsonTimestamp value)
BsonWriterwriteTimestamp in interface BsonWritervalue - The combined timestamp/increment value.public void writeUndefined(String name)
BsonWriterwriteUndefined in interface BsonWritername - The name of the element.public void writeUndefined()
BsonWriterwriteUndefined in interface BsonWriterpublic void pipe(BsonReader reader)
BsonWriterpipe in interface BsonWriterreader - The source.public void pipe(BsonReader reader, List<BsonElement> extraElements)
BsonWriterpipe in interface BsonWriterreader - The source.extraElements - The extra BSON elements to appendpublic void flush()
BsonWriterflush in interface BsonWriter